當前位置: 首頁>>代碼示例>>Java>>正文


Java OperatorCreationException.getMessage方法代碼示例

本文整理匯總了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());
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:26,代碼來源:CertificateRequestMessage.java

示例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());
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:25,代碼來源:CertificateStatus.java

示例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);
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:25,代碼來源:PKCS8Generator.java

示例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);
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:35,代碼來源:CertificateConfirmationContentBuilder.java

示例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);
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:13,代碼來源:CertificateID.java

示例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);
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:36,代碼來源:SignerInformation.java

示例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;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:52,代碼來源:CMSSignedData.java

示例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);
}
 
開發者ID:xipki,項目名稱:xitk,代碼行數:15,代碼來源:PrivateKeyCryptor.java


注:本文中的org.bouncycastle.operator.OperatorCreationException.getMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。