Bewerken

Share via


Pkcs12SafeContents.Decrypt Method

Definition

Overloads

Decrypt(Byte[])

Decrypts the contents of this SafeContents value using a byte-based password from an array.

Decrypt(ReadOnlySpan<Byte>)

Decrypts the contents of this SafeContents value using a byte-based password from a span.

Decrypt(ReadOnlySpan<Char>)

Decrypts the contents of this SafeContents value using a character-based password from a span.

Decrypt(String)

Decrypts the contents of this SafeContents value using a character-based password from a string.

Decrypt(Byte[])

Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs

Decrypts the contents of this SafeContents value using a byte-based password from an array.

public:
 void Decrypt(cli::array <System::Byte> ^ passwordBytes);
public void Decrypt (byte[]? passwordBytes);
public void Decrypt (byte[] passwordBytes);
member this.Decrypt : byte[] -> unit
Public Sub Decrypt (passwordBytes As Byte())

Parameters

passwordBytes
Byte[]

The bytes to use as a password for decrypting the encrypted contents.

Exceptions

The password is incorrect.

-or-

The contents were not successfully decrypted.

Remarks

The password bytes are passed directly into the Key Derivation Function (KDF) used by the algorithm indicated by the encrypted contents. This enables compatibility with other systems which use a text encoding other than UTF-8 when processing passwords with PBKDF2 (Password-Based Key Derivation Function 2).

Applies to

Decrypt(ReadOnlySpan<Byte>)

Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs

Decrypts the contents of this SafeContents value using a byte-based password from a span.

public:
 void Decrypt(ReadOnlySpan<System::Byte> passwordBytes);
public void Decrypt (ReadOnlySpan<byte> passwordBytes);
member this.Decrypt : ReadOnlySpan<byte> -> unit
Public Sub Decrypt (passwordBytes As ReadOnlySpan(Of Byte))

Parameters

passwordBytes
ReadOnlySpan<Byte>

The bytes to use as a password for decrypting the encrypted contents.

Exceptions

The password is incorrect.

-or-

The contents were not successfully decrypted.

Remarks

The password bytes are passed directly into the Key Derivation Function (KDF) used by the algorithm indicated by the encrypted contents. This enables compatibility with other systems which use a text encoding other than UTF-8 when processing passwords with PBKDF2 (Password-Based Key Derivation Function 2).

Applies to

Decrypt(ReadOnlySpan<Char>)

Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs

Decrypts the contents of this SafeContents value using a character-based password from a span.

public:
 void Decrypt(ReadOnlySpan<char> password);
public void Decrypt (ReadOnlySpan<char> password);
member this.Decrypt : ReadOnlySpan<char> -> unit
Public Sub Decrypt (password As ReadOnlySpan(Of Char))

Parameters

password
ReadOnlySpan<Char>

The password to use for decrypting the encrypted contents.

Exceptions

The password is incorrect.

-or-

The contents were not successfully decrypted.

Remarks

When the encrypted contents indicate an algorithm that uses PBKDF1 (Password-Based Key Derivation Function 1) or PBKDF2 (Password-Based Key Derivation Function 2), the password is converted to bytes via the UTF-8 encoding.

Applies to

Decrypt(String)

Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs
Source:
Pkcs12SafeContents.cs

Decrypts the contents of this SafeContents value using a character-based password from a string.

public:
 void Decrypt(System::String ^ password);
public void Decrypt (string? password);
public void Decrypt (string password);
member this.Decrypt : string -> unit
Public Sub Decrypt (password As String)

Parameters

password
String

The password to use for decrypting the encrypted contents.

Exceptions

The password is incorrect.

-or-

The contents were not successfully decrypted.

Remarks

When the encrypted contents indicate an algorithm that uses PBKDF1 (Password-Based Key Derivation Function 1) or PBKDF2 (Password-Based Key Derivation Function 2), the password is converted to bytes via the UTF-8 encoding.

Applies to