Bouncy Castle Cryptography Library 1.79

org.bouncycastle.cert.cmp
Class ProtectedPKIMessage

java.lang.Object
  |
  +--org.bouncycastle.cert.cmp.ProtectedPKIMessage

public class ProtectedPKIMessage
extends java.lang.Object

Wrapper for a PKIMessage with protection attached to it.


Constructor Summary
ProtectedPKIMessage(GeneralPKIMessage pkiMessage)
          Base constructor.
 
Method Summary
 org.bouncycastle.asn1.cmp.PKIBody getBody()
          Return the message body.
 X509CertificateHolder[] getCertificates()
          Return the extra certificates associated with this message.
 org.bouncycastle.asn1.cmp.PKIHeader getHeader()
          Return the message header.
 org.bouncycastle.asn1.x509.AlgorithmIdentifier getProtectionAlgorithm()
          Return the message's protection algorithm.
 boolean hasPasswordBasedMacProtection()
          Determine whether the message is protected by a CMP password based MAC.
 org.bouncycastle.asn1.cmp.PKIMessage toASN1Structure()
          Return the underlying ASN.1 structure contained in this object.
 boolean verify(ContentVerifierProvider verifierProvider)
          Verify a message with a public key based signature attached.
 boolean verify(PBEMacCalculatorProvider pbeMacCalculatorProvider, char[] password)
          Verify a message with password based MAC protection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtectedPKIMessage

public ProtectedPKIMessage(GeneralPKIMessage pkiMessage)
Base constructor.
Parameters:
pkiMessage - a GeneralPKIMessage with
Method Detail

getHeader

public org.bouncycastle.asn1.cmp.PKIHeader getHeader()
Return the message header.
Returns:
the message's PKIHeader structure.

getBody

public org.bouncycastle.asn1.cmp.PKIBody getBody()
Return the message body.
Returns:
the message's PKIBody structure.

toASN1Structure

public org.bouncycastle.asn1.cmp.PKIMessage toASN1Structure()
Return the underlying ASN.1 structure contained in this object.
Returns:
a PKIMessage structure.

hasPasswordBasedMacProtection

public boolean hasPasswordBasedMacProtection()
Determine whether the message is protected by a CMP password based MAC. Use verify(PBEMacCalculatorProvider, char[]) to verify the message if this method returns true.
Returns:
true if protection MAC PBE based, false otherwise.

getProtectionAlgorithm

public org.bouncycastle.asn1.x509.AlgorithmIdentifier getProtectionAlgorithm()
Return the message's protection algorithm.
Returns:
the algorithm ID for the message's protection algorithm.

getCertificates

public X509CertificateHolder[] getCertificates()
Return the extra certificates associated with this message.
Returns:
an array of extra certificates, zero length if none present.

verify

public boolean verify(ContentVerifierProvider verifierProvider)
               throws CMPException
Verify a message with a public key based signature attached.
Parameters:
verifierProvider - a provider of signature verifiers.
Returns:
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.

verify

public boolean verify(PBEMacCalculatorProvider pbeMacCalculatorProvider,
                      char[] password)
               throws CMPException
Verify a message with password based MAC protection.
Parameters:
pbeMacCalculatorProvider - MAC builder that can be used to construct the appropriate MacCalculator
password - the MAC password
Returns:
true if the passed in password and MAC builder verify the message, false otherwise.
Throws:
CMPException - if algorithm not MAC based, or an exception is thrown verifying the MAC.

Bouncy Castle Cryptography Library 1.79