本文整理匯總了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);
}