当前位置: 首页>>代码示例>>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;未经允许,请勿转载。