Table of Contents

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

pkiMessage PkiMessage

The PKI message

Exceptions

ArgumentException

If the PKI message does not have protection.

ProtectedPkiMessage(GeneralPkiMessage)

Wrap a general message.

public ProtectedPkiMessage(GeneralPkiMessage pkiMessage)

Parameters

pkiMessage GeneralPkiMessage

The General message

Exceptions

ArgumentException

If the general message does not have protection.

Properties

Body

Message body

public virtual PkiBody Body { get; }

Property Value

PkiBody

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

PkiHeader

ProtectionAlgorithm

public virtual AlgorithmIdentifier ProtectionAlgorithm { get; }

Property Value

AlgorithmIdentifier

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

pkMacBuilder PKMacBuilder

MAC builder that can be used to construct the appropriate MacCalculator

password char[]

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

pkMacBuilder PKMacBuilder
password ReadOnlySpan<char>

Returns

bool

Verify(AsymmetricKeyParameter)

public virtual bool Verify(AsymmetricKeyParameter publicKey)

Parameters

publicKey AsymmetricKeyParameter

Returns

bool

Verify(IVerifierFactory)

Verify a message with a public key based signature attached.

public virtual bool Verify(IVerifierFactory verifierFactory)

Parameters

verifierFactory IVerifierFactory

a 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

verifierProvider IVerifierFactoryProvider

Returns

bool