当前位置: 首页>>代码示例>>Java>>正文


Java ContentVerifierProvider.get方法代码示例

本文整理汇总了Java中org.bouncycastle.operator.ContentVerifierProvider.get方法的典型用法代码示例。如果您正苦于以下问题:Java ContentVerifierProvider.get方法的具体用法?Java ContentVerifierProvider.get怎么用?Java ContentVerifierProvider.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bouncycastle.operator.ContentVerifierProvider的用法示例。


在下文中一共展示了ContentVerifierProvider.get方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: verifySignature

import org.bouncycastle.operator.ContentVerifierProvider; //导入方法依赖的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: verify

import org.bouncycastle.operator.ContentVerifierProvider; //导入方法依赖的package包/类
/**
 * Verify a message with a public key based signature attached.
 *
 * @param verifierProvider a provider of signature verifiers.
 * @return true if the provider is able to create a verifier that validates
 * the signature, false otherwise.
 * @throws CMPException if an exception is thrown trying to verify the signature.
 */
public boolean verify(ContentVerifierProvider verifierProvider)
    throws CMPException
{
    ContentVerifier verifier;
    try
    {
        verifier = verifierProvider.get(pkiMessage.getHeader().getProtectionAlg());

        return verifySignature(pkiMessage.getProtection().getBytes(), verifier);
    }
    catch (Exception e)
    {
        throw new CMPException("unable to verify signature: " + e.getMessage(), e);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:24,代码来源:ProtectedPKIMessage.java

示例3: isSignatureValid

import org.bouncycastle.operator.ContentVerifierProvider; //导入方法依赖的package包/类
/**
 * verify the signature against the TBSRequest object we contain.
 */
public boolean isSignatureValid(
    ContentVerifierProvider verifierProvider)
    throws OCSPException
{
    if (!this.isSigned())
    {
        throw new OCSPException("attempt to verify signature on unsigned object");
    }

    try
    {
        ContentVerifier verifier = verifierProvider.get(req.getOptionalSignature().getSignatureAlgorithm());
        OutputStream sOut = verifier.getOutputStream();

        sOut.write(req.getTbsRequest().getEncoded(ASN1Encoding.DER));

        return verifier.verify(this.getSignature());
    }
    catch (Exception e)
    {
        throw new OCSPException("exception processing signature: " + e, e);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:27,代码来源:OCSPReq.java

示例4: isSignatureValid

import org.bouncycastle.operator.ContentVerifierProvider; //导入方法依赖的package包/类
/**
 * verify the signature against the tbsResponseData object we contain.
 */
public boolean isSignatureValid(
    ContentVerifierProvider verifierProvider)
    throws OCSPException
{
    try
    {
        ContentVerifier verifier = verifierProvider.get(resp.getSignatureAlgorithm());
        OutputStream vOut = verifier.getOutputStream();

        vOut.write(resp.getTbsResponseData().getEncoded(ASN1Encoding.DER));
        vOut.close();

        return verifier.verify(this.getSignature());
    }
    catch (Exception e)
    {
        throw new OCSPException("exception processing sig: " + e, e);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:23,代码来源:BasicOCSPResp.java

示例5: isSignatureValid

import org.bouncycastle.operator.ContentVerifierProvider; //导入方法依赖的package包/类
/**
 * Validate the signature on the PKCS10 certification request in this holder.
 *
 * @param verifierProvider a ContentVerifierProvider that can generate a verifier for the signature.
 * @return true if the signature is valid, false otherwise.
 * @throws PKCSException if the signature cannot be processed or is inappropriate.
 */
public boolean isSignatureValid(ContentVerifierProvider verifierProvider)
    throws PKCSException
{
    CertificationRequestInfo requestInfo = certificationRequest.getCertificationRequestInfo();

    ContentVerifier verifier;

    try
    {
        verifier = verifierProvider.get(certificationRequest.getSignatureAlgorithm());

        OutputStream sOut = verifier.getOutputStream();

        sOut.write(requestInfo.getEncoded(ASN1Encoding.DER));

        sOut.close();
    }
    catch (Exception e)
    {
        throw new PKCSException("unable to process signature: " + e.getMessage(), e);
    }

    return verifier.verify(certificationRequest.getSignature().getBytes());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:32,代码来源:PKCS10CertificationRequest.java

示例6: verifySignature

import org.bouncycastle.operator.ContentVerifierProvider; //导入方法依赖的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().getOctets());
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:26,代码来源:CertificateRequestMessage.java

示例7: isSignatureValid

import org.bouncycastle.operator.ContentVerifierProvider; //导入方法依赖的package包/类
/**
 * Validate the signature on the PKCS10 certification request in this holder.
 *
 * @param verifierProvider a ContentVerifierProvider that can generate a verifier for the signature.
 * @return true if the signature is valid, false otherwise.
 * @throws PKCSException if the signature cannot be processed or is inappropriate.
 */
public boolean isSignatureValid(ContentVerifierProvider verifierProvider)
    throws PKCSException
{
    CertificationRequestInfo requestInfo = certificationRequest.getCertificationRequestInfo();

    ContentVerifier verifier;

    try
    {
        verifier = verifierProvider.get(certificationRequest.getSignatureAlgorithm());

        OutputStream sOut = verifier.getOutputStream();

        sOut.write(requestInfo.getEncoded(ASN1Encoding.DER));

        sOut.close();
    }
    catch (Exception e)
    {
        throw new PKCSException("unable to process signature: " + e.getMessage(), e);
    }

    return verifier.verify(this.getSignature());
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:32,代码来源:PKCS10CertificationRequest.java

示例8: isSignatureValid

import org.bouncycastle.operator.ContentVerifierProvider; //导入方法依赖的package包/类
/**
 * Validate the signature on the certificate in this holder.
 *
 * @param verifierProvider a ContentVerifierProvider that can generate a verifier for the signature.
 * @return true if the signature is valid, false otherwise.
 * @throws CertException if the signature cannot be processed or is inappropriate.
 */
public boolean isSignatureValid(ContentVerifierProvider verifierProvider)
    throws CertException
{
    TBSCertificate tbsCert = x509Certificate.getTBSCertificate();

    if (!CertUtils.isAlgIdEqual(tbsCert.getSignature(), x509Certificate.getSignatureAlgorithm()))
    {
        throw new CertException("signature invalid - algorithm identifier mismatch");
    }

    ContentVerifier verifier;

    try
    {
        verifier = verifierProvider.get((tbsCert.getSignature()));

        OutputStream sOut = verifier.getOutputStream();
        DEROutputStream dOut = new DEROutputStream(sOut);

        dOut.writeObject(tbsCert);

        sOut.close();
    }
    catch (Exception e)
    {
        throw new CertException("unable to process signature: " + e.getMessage(), e);
    }

    return verifier.verify(x509Certificate.getSignature().getBytes());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:38,代码来源:X509CertificateHolder.java

示例9: isSignatureValid

import org.bouncycastle.operator.ContentVerifierProvider; //导入方法依赖的package包/类
/**
 * Validate the signature on the CRL.
 *
 * @param verifierProvider a ContentVerifierProvider that can generate a verifier for the signature.
 * @return true if the signature is valid, false otherwise.
 * @throws CertException if the signature cannot be processed or is inappropriate.
 */
public boolean isSignatureValid(ContentVerifierProvider verifierProvider)
    throws CertException
{
    TBSCertList tbsCRL = x509CRL.getTBSCertList();

    if (!CertUtils.isAlgIdEqual(tbsCRL.getSignature(), x509CRL.getSignatureAlgorithm()))
    {
        throw new CertException("signature invalid - algorithm identifier mismatch");
    }

    ContentVerifier verifier;

    try
    {
        verifier = verifierProvider.get((tbsCRL.getSignature()));

        OutputStream sOut = verifier.getOutputStream();
        DEROutputStream dOut = new DEROutputStream(sOut);

        dOut.writeObject(tbsCRL);

        sOut.close();
    }
    catch (Exception e)
    {
        throw new CertException("unable to process signature: " + e.getMessage(), e);
    }

    return verifier.verify(x509CRL.getSignature().getBytes());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:38,代码来源:X509CRLHolder.java

示例10: isSignatureValid

import org.bouncycastle.operator.ContentVerifierProvider; //导入方法依赖的package包/类
/**
 * Validate the signature on the attribute certificate in this holder.
 *
 * @param verifierProvider a ContentVerifierProvider that can generate a verifier for the signature.
 * @return true if the signature is valid, false otherwise.
 * @throws CertException if the signature cannot be processed or is inappropriate.
 */
public boolean isSignatureValid(ContentVerifierProvider verifierProvider)
    throws CertException
{
    AttributeCertificateInfo acinfo = attrCert.getAcinfo();

    if (!CertUtils.isAlgIdEqual(acinfo.getSignature(), attrCert.getSignatureAlgorithm()))
    {
        throw new CertException("signature invalid - algorithm identifier mismatch");
    }

    ContentVerifier verifier;

    try
    {
        verifier = verifierProvider.get((acinfo.getSignature()));

        OutputStream sOut = verifier.getOutputStream();
        DEROutputStream dOut = new DEROutputStream(sOut);

        dOut.writeObject(acinfo);

        sOut.close();
    }
    catch (Exception e)
    {
        throw new CertException("unable to process signature: " + e.getMessage(), e);
    }

    return verifier.verify(attrCert.getSignatureValue().getBytes());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:38,代码来源:X509AttributeCertificateHolder.java

示例11: isSignatureValid

import org.bouncycastle.operator.ContentVerifierProvider; //导入方法依赖的package包/类
/**
 * Validate the signature on the CRL.
 *
 * @param verifierProvider a ContentVerifierProvider that can generate a verifier for the signature.
 * @return true if the signature is valid, false otherwise.
 * @throws CertException if the signature cannot be processed or is inappropriate.
 */
public boolean isSignatureValid(ContentVerifierProvider verifierProvider)
    throws CertException
{
    TBSCertList tbsCRL = x509CRL.getTBSCertList();

    if (!CertUtils.isAlgIdEqual(tbsCRL.getSignature(), x509CRL.getSignatureAlgorithm()))
    {
        throw new CertException("signature invalid - algorithm identifier mismatch");
    }

    ContentVerifier verifier;

    try
    {
        verifier = verifierProvider.get((tbsCRL.getSignature()));

        OutputStream sOut = verifier.getOutputStream();
        DEROutputStream dOut = new DEROutputStream(sOut);

        dOut.writeObject(tbsCRL);

        sOut.close();
    }
    catch (Exception e)
    {
        throw new CertException("unable to process signature: " + e.getMessage(), e);
    }

    return verifier.verify(x509CRL.getSignature().getOctets());
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:38,代码来源:X509CRLHolder.java

示例12: isSignatureValid

import org.bouncycastle.operator.ContentVerifierProvider; //导入方法依赖的package包/类
public boolean isSignatureValid(ContentVerifierProvider verifierProvider)
    throws OperatorCreationException, IOException
{
    ContentVerifier verifier = verifierProvider.get(spkacSeq.getSignatureAlgorithm());

    OutputStream sOut = verifier.getOutputStream();
    DEROutputStream dOut = new DEROutputStream(sOut);

    dOut.writeObject(spkacSeq.getPublicKeyAndChallenge());

    sOut.close();

    return verifier.verify(spkacSeq.getSignature().getOctets());
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:15,代码来源:SignedPublicKeyAndChallenge.java

示例13: isSignatureValid

import org.bouncycastle.operator.ContentVerifierProvider; //导入方法依赖的package包/类
/**
 * Validate the signature on the certificate in this holder.
 *
 * @param verifierProvider a ContentVerifierProvider that can generate a verifier for the signature.
 * @return true if the signature is valid, false otherwise.
 * @throws CertException if the signature cannot be processed or is inappropriate.
 */
public boolean isSignatureValid(ContentVerifierProvider verifierProvider)
    throws CertException
{
    TBSCertificate tbsCert = x509Certificate.getTBSCertificate();

    if (!CertUtils.isAlgIdEqual(tbsCert.getSignature(), x509Certificate.getSignatureAlgorithm()))
    {
        throw new CertException("signature invalid - algorithm identifier mismatch");
    }

    ContentVerifier verifier;

    try
    {
        verifier = verifierProvider.get((tbsCert.getSignature()));

        OutputStream sOut = verifier.getOutputStream();
        DEROutputStream dOut = new DEROutputStream(sOut);

        dOut.writeObject(tbsCert);

        sOut.close();
    }
    catch (Exception e)
    {
        throw new CertException("unable to process signature: " + e.getMessage(), e);
    }

    return verifier.verify(this.getSignature());
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:38,代码来源:X509CertificateHolder.java

示例14: isSignatureValid

import org.bouncycastle.operator.ContentVerifierProvider; //导入方法依赖的package包/类
/**
 * Validate the signature on the attribute certificate in this holder.
 *
 * @param verifierProvider a ContentVerifierProvider that can generate a verifier for the signature.
 * @return true if the signature is valid, false otherwise.
 * @throws CertException if the signature cannot be processed or is inappropriate.
 */
public boolean isSignatureValid(ContentVerifierProvider verifierProvider)
    throws CertException
{
    AttributeCertificateInfo acinfo = attrCert.getAcinfo();

    if (!CertUtils.isAlgIdEqual(acinfo.getSignature(), attrCert.getSignatureAlgorithm()))
    {
        throw new CertException("signature invalid - algorithm identifier mismatch");
    }

    ContentVerifier verifier;

    try
    {
        verifier = verifierProvider.get((acinfo.getSignature()));

        OutputStream sOut = verifier.getOutputStream();
        DEROutputStream dOut = new DEROutputStream(sOut);

        dOut.writeObject(acinfo);

        sOut.close();
    }
    catch (Exception e)
    {
        throw new CertException("unable to process signature: " + e.getMessage(), e);
    }

    return verifier.verify(this.getSignature());
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:38,代码来源:X509AttributeCertificateHolder.java


注:本文中的org.bouncycastle.operator.ContentVerifierProvider.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。