本文整理汇总了Java中org.bouncycastle.operator.OperatorCreationException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java OperatorCreationException.getMessage方法的具体用法?Java OperatorCreationException.getMessage怎么用?Java OperatorCreationException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.operator.OperatorCreationException
的用法示例。
在下文中一共展示了OperatorCreationException.getMessage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: verifySignature
import org.bouncycastle.operator.OperatorCreationException; //导入方法依赖的package包/类
private boolean verifySignature(ContentVerifierProvider verifierProvider, POPOSigningKey popoSign)
throws CRMFException
{
ContentVerifier verifier;
try
{
verifier = verifierProvider.get(popoSign.getAlgorithmIdentifier());
}
catch (OperatorCreationException e)
{
throw new CRMFException("unable to create verifier: " + e.getMessage(), e);
}
if (popoSign.getPoposkInput() != null)
{
CRMFUtil.derEncodeToStream(popoSign.getPoposkInput(), verifier.getOutputStream());
}
else
{
CRMFUtil.derEncodeToStream(certReqMsg.getCertReq(), verifier.getOutputStream());
}
return verifier.verify(popoSign.getSignature().getBytes());
}
示例2: isVerified
import org.bouncycastle.operator.OperatorCreationException; //导入方法依赖的package包/类
public boolean isVerified(X509CertificateHolder certHolder, DigestCalculatorProvider digesterProvider)
throws CMPException
{
AlgorithmIdentifier digAlg = digestAlgFinder.find(certHolder.toASN1Structure().getSignatureAlgorithm());
if (digAlg == null)
{
throw new CMPException("cannot find algorithm for digest from signature");
}
DigestCalculator digester;
try
{
digester = digesterProvider.get(digAlg);
}
catch (OperatorCreationException e)
{
throw new CMPException("unable to create digester: " + e.getMessage(), e);
}
CMPUtil.derEncodeToStream(certHolder.toASN1Structure(), digester.getOutputStream());
return Arrays.areEqual(certStatus.getCertHash().getOctets(), digester.getDigest());
}
示例3: generate
import org.bouncycastle.operator.OperatorCreationException; //导入方法依赖的package包/类
public PemObject generate()
throws PemGenerationException
{
try
{
if (encryptorBuilder != null)
{
outputEncryptor = encryptorBuilder.build();
}
}
catch (OperatorCreationException e)
{
throw new PemGenerationException("unable to create operator: " + e.getMessage(), e);
}
if (outputEncryptor != null)
{
return generate(key, outputEncryptor);
}
else
{
return generate(key, null);
}
}
示例4: build
import org.bouncycastle.operator.OperatorCreationException; //导入方法依赖的package包/类
public CertificateConfirmationContent build(DigestCalculatorProvider digesterProvider)
throws CMPException
{
ASN1EncodableVector v = new ASN1EncodableVector();
for (int i = 0; i != acceptedCerts.size(); i++)
{
X509CertificateHolder certHolder = (X509CertificateHolder)acceptedCerts.get(i);
BigInteger reqID = (BigInteger)acceptedReqIds.get(i);
AlgorithmIdentifier digAlg = digestAlgFinder.find(certHolder.toASN1Structure().getSignatureAlgorithm());
if (digAlg == null)
{
throw new CMPException("cannot find algorithm for digest from signature");
}
DigestCalculator digester;
try
{
digester = digesterProvider.get(digAlg);
}
catch (OperatorCreationException e)
{
throw new CMPException("unable to create digest: " + e.getMessage(), e);
}
CMPUtil.derEncodeToStream(certHolder.toASN1Structure(), digester.getOutputStream());
v.add(new CertStatus(digester.getDigest(), reqID));
}
return new CertificateConfirmationContent(CertConfirmContent.getInstance(new DERSequence(v)), digestAlgFinder);
}
示例5: matchesIssuer
import org.bouncycastle.operator.OperatorCreationException; //导入方法依赖的package包/类
public boolean matchesIssuer(X509CertificateHolder issuerCert, DigestCalculatorProvider digCalcProvider)
throws OCSPException
{
try
{
return createCertID(digCalcProvider.get(id.getHashAlgorithm()), issuerCert, id.getSerialNumber()).equals(id);
}
catch (OperatorCreationException e)
{
throw new OCSPException("unable to create digest calculator: " + e.getMessage(), e);
}
}
示例6: doVerify
import org.bouncycastle.operator.OperatorCreationException; //导入方法依赖的package包/类
/**
* @deprecated
*/
private boolean doVerify(
PublicKey key,
Provider sigProvider)
throws CMSException, NoSuchAlgorithmException
{
try
{
SignerInformationVerifier verifier;
if (sigProvider != null)
{
if (!sigProvider.getName().equalsIgnoreCase("BC"))
{
verifier = new JcaSignerInfoVerifierBuilder(new JcaDigestCalculatorProviderBuilder().build()).setProvider(sigProvider).build(key);
}
else
{
verifier = new JcaSimpleSignerInfoVerifierBuilder().setProvider(sigProvider).build(key);
}
}
else
{
verifier = new JcaSimpleSignerInfoVerifierBuilder().build(key);
}
return doVerify(verifier);
}
catch (OperatorCreationException e)
{
throw new CMSException("unable to create verifier: " + e.getMessage(), e);
}
}
示例7: verifySignatures
import org.bouncycastle.operator.OperatorCreationException; //导入方法依赖的package包/类
/**
* Verify all the SignerInformation objects and optionally their associated counter signatures attached
* to this CMS SignedData object.
*
* @param verifierProvider a provider of SignerInformationVerifier objects.
* @param ignoreCounterSignatures if true don't check counter signatures. If false check counter signatures as well.
* @return true if all verify, false otherwise.
* @throws CMSException if an exception occurs during the verification process.
*/
public boolean verifySignatures(SignerInformationVerifierProvider verifierProvider, boolean ignoreCounterSignatures)
throws CMSException
{
Collection signers = this.getSignerInfos().getSigners();
for (Iterator it = signers.iterator(); it.hasNext();)
{
SignerInformation signer = (SignerInformation)it.next();
try
{
SignerInformationVerifier verifier = verifierProvider.get(signer.getSID());
if (!signer.verify(verifier))
{
return false;
}
if (!ignoreCounterSignatures)
{
Collection counterSigners = signer.getCounterSignatures().getSigners();
for (Iterator cIt = counterSigners.iterator(); cIt.hasNext();)
{
SignerInformation counterSigner = (SignerInformation)cIt.next();
SignerInformationVerifier counterVerifier = verifierProvider.get(signer.getSID());
if (!counterSigner.verify(counterVerifier))
{
return false;
}
}
}
}
catch (OperatorCreationException e)
{
throw new CMSException("failure in verifier provider: " + e.getMessage(), e);
}
}
return true;
}
示例8: PrivateKeyCryptor
import org.bouncycastle.operator.OperatorCreationException; //导入方法依赖的package包/类
PrivateKeyCryptor(char[] password) throws P11TokenException {
ParamUtil.requireNonNull("password", password);
JcePKCSPBEOutputEncryptorBuilder eb = new JcePKCSPBEOutputEncryptorBuilder(ALGO);
eb.setProvider("BC");
eb.setIterationCount(ITERATION_COUNT);
try {
encryptor = eb.build(password);
} catch (OperatorCreationException ex) {
throw new P11TokenException(ex.getMessage(), ex);
}
JcePKCSPBEInputDecryptorProviderBuilder db = new JcePKCSPBEInputDecryptorProviderBuilder();
decryptorProvider = db.build(password);
}