Edit

Share via


Pkcs8PrivateKeyInfo Class

Definition

Enables the inspection of and creation of PKCS#8 PrivateKeyInfo and EncryptedPrivateKeyInfo values. This class cannot be inherited.

public ref class Pkcs8PrivateKeyInfo sealed
public sealed class Pkcs8PrivateKeyInfo
type Pkcs8PrivateKeyInfo = class
Public NotInheritable Class Pkcs8PrivateKeyInfo
Inheritance
Pkcs8PrivateKeyInfo

Constructors

Pkcs8PrivateKeyInfo(Oid, Nullable<ReadOnlyMemory<Byte>>, ReadOnlyMemory<Byte>, Boolean)

Initializes a new instance of the Pkcs8PrivateKeyInfo class.

Properties

AlgorithmId

Gets the Object Identifier (OID) value identifying the algorithm this key is for.

AlgorithmParameters

Gets a memory value containing the BER-encoded algorithm parameters associated with this key.

Attributes

Gets the modifiable collection of attributes for this private key.

PrivateKeyBytes

Gets a memory value that represents the algorithm-specific encoded private key.

Methods

Create(AsymmetricAlgorithm)

Exports a specified key as a PKCS#8 PrivateKeyInfo and returns its decoded interpretation.

Decode(ReadOnlyMemory<Byte>, Int32, Boolean)

Reads the provided data as a PKCS#8 PrivateKeyInfo and returns an object view of the contents.

DecryptAndDecode(ReadOnlySpan<Byte>, ReadOnlyMemory<Byte>, Int32)

Decrypts the provided data using the provided byte-based password and decodes the output into an object view of the PKCS#8 PrivateKeyInfo.

DecryptAndDecode(ReadOnlySpan<Char>, ReadOnlyMemory<Byte>, Int32)

Decrypts the provided data using the provided character-based password and decodes the output into an object view of the PKCS#8 PrivateKeyInfo.

Encode()

Encodes the property data of this instance as a PKCS#8 PrivateKeyInfo and returns the encoding as a byte array.

Encrypt(ReadOnlySpan<Byte>, PbeParameters)

Produces a PKCS#8 EncryptedPrivateKeyInfo from the property contents of this object after encrypting with the specified byte-based password and encryption parameters.

Encrypt(ReadOnlySpan<Char>, PbeParameters)

Produces a PKCS#8 EncryptedPrivateKeyInfo from the property contents of this object after encrypting with the specified character-based password and encryption parameters.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)
TryEncode(Span<Byte>, Int32)

Attempts to encode the property data of this instance as a PKCS#8 PrivateKeyInfo, writing the results into a provided buffer.

TryEncrypt(ReadOnlySpan<Byte>, PbeParameters, Span<Byte>, Int32)

Attempts to produce a PKCS#8 EncryptedPrivateKeyInfo from the property contents of this object after encrypting with the specified byte-based password and encryption parameters, writing the results into a provided buffer.

TryEncrypt(ReadOnlySpan<Char>, PbeParameters, Span<Byte>, Int32)

Attempts to produce a PKCS#8 EncryptedPrivateKeyInfo from the property contents of this object after encrypting with the specified character-based password and encryption parameters, writing the result into a provided buffer.

Applies to