Example usage for org.bouncycastle.cms CMSSignedData verifySignatures

List of usage examples for org.bouncycastle.cms CMSSignedData verifySignatures

Introduction

In this page you can find the example usage for org.bouncycastle.cms CMSSignedData verifySignatures.

Prototype

public boolean verifySignatures(SignerInformationVerifierProvider verifierProvider) throws CMSException 

Source Link

Document

Verify all the SignerInformation objects and their associated counter signatures attached to this CMS SignedData object.

Usage

From source file:org.ejbca.core.protocol.scep.ScepRequestMessage.java

License:Open Source License

/**
 * This method verifies the signature of the PKCS#7 wrapper of this message. 
 * //from  w ww.  j  a va 2s .  co m
 * @param publicKey the public key of the keypair that signed this message
 * @return true if signature verifies. 
 * @throws CMSException if the underlying byte array of this SCEP message couldn't be read
 * @throws OperatorCreationException if a signature verifier couldn't be constructed from the given public key
 */
public boolean verifySignature(PublicKey publicKey) throws CMSException, OperatorCreationException {
    CMSSignedData cmsSignedData = new CMSSignedData(scepmsg);
    return cmsSignedData.verifySignatures(new ScepVerifierProvider(publicKey));
}