Pkcs8PrivateKeyInfo Class

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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

C#
public sealed class Pkcs8PrivateKeyInfo
Inheritance
Pkcs8PrivateKeyInfo

Constructors

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.

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

Proizvod Verzije
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.1 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10