Class ProtectedPkiMessage
- Namespace
- Org.BouncyCastle.Cmp
- Assembly
- BouncyCastle.Cryptography.dll
Wrapper for a PKIMessage with protection attached to it.
public class ProtectedPkiMessage
- Inheritance
-
ProtectedPkiMessage
- Inherited Members
Constructors
ProtectedPkiMessage(PkiMessage)
Wrap a PKI message.
public ProtectedPkiMessage(PkiMessage pkiMessage)
Parameters
pkiMessagePkiMessageThe PKI message
Exceptions
- ArgumentException
If the PKI message does not have protection.
ProtectedPkiMessage(GeneralPkiMessage)
Wrap a general message.
public ProtectedPkiMessage(GeneralPkiMessage pkiMessage)
Parameters
pkiMessageGeneralPkiMessageThe General message
Exceptions
- ArgumentException
If the general message does not have protection.
Properties
Body
Message body
public virtual PkiBody Body { get; }
Property Value
HasPasswordBasedMacProtected
Determine whether the message is protected by a password based MAC. Use verify(PKMACBuilder, char[]) to verify the message if this method returns true.
public virtual bool HasPasswordBasedMacProtected { get; }
Property Value
- bool
true if protection MAC PBE based, false otherwise.
Header
Message header
public virtual PkiHeader Header { get; }
Property Value
ProtectionAlgorithm
public virtual AlgorithmIdentifier ProtectionAlgorithm { get; }
Property Value
Methods
GetCertificates()
Return the extra certificates associated with this message.
public virtual X509Certificate[] GetCertificates()
Returns
- X509Certificate[]
an array of extra certificates, zero length if none present.
ToAsn1Message()
Return the underlying ASN.1 structure contained in this object.
public virtual PkiMessage ToAsn1Message()
Returns
- PkiMessage
PkiMessage structure
Verify(PKMacBuilder, char[])
Verify a message with password based MAC protection.
public virtual bool Verify(PKMacBuilder pkMacBuilder, char[] password)
Parameters
pkMacBuilderPKMacBuilderMAC builder that can be used to construct the appropriate MacCalculator
passwordchar[]the MAC password
Returns
- bool
true if the passed in password and MAC builder verify the message, false otherwise.
Exceptions
- InvalidOperationException
if algorithm not MAC based, or an exception is thrown verifying the MAC.
Verify(PKMacBuilder, ReadOnlySpan<char>)
public virtual bool Verify(PKMacBuilder pkMacBuilder, ReadOnlySpan<char> password)
Parameters
pkMacBuilderPKMacBuilderpasswordReadOnlySpan<char>
Returns
Verify(AsymmetricKeyParameter)
public virtual bool Verify(AsymmetricKeyParameter publicKey)
Parameters
publicKeyAsymmetricKeyParameter
Returns
Verify(IVerifierFactory)
Verify a message with a public key based signature attached.
public virtual bool Verify(IVerifierFactory verifierFactory)
Parameters
verifierFactoryIVerifierFactorya factory of signature verifiers.
Returns
- bool
true if the provider is able to create a verifier that validates the signature, false otherwise.
Verify(IVerifierFactoryProvider)
public virtual bool Verify(IVerifierFactoryProvider verifierProvider)
Parameters
verifierProviderIVerifierFactoryProvider