Package org.bouncycastle.cert.cmp
Class ProtectedPKIMessage
java.lang.Object
org.bouncycastle.cert.cmp.ProtectedPKIMessage
Wrapper for a PKIMessage with protection attached to it.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.asn1.cmp.PKIBody
getBody()
Return the message body.Return the extra certificates associated with this message.org.bouncycastle.asn1.cmp.PKIHeader
Return the message header.org.bouncycastle.asn1.x509.AlgorithmIdentifier
Return the message's protection algorithm.boolean
Determine whether the message is protected by a CMP password based MAC.org.bouncycastle.asn1.cmp.PKIMessage
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.
-
Constructor Details
-
ProtectedPKIMessage
Base constructor.- Parameters:
pkiMessage
- a GeneralPKIMessage with
-
-
Method Details
-
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
Return the extra certificates associated with this message.- Returns:
- an array of extra certificates, zero length if none present.
-
verify
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 MacCalculatorpassword
- 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.
-