ECAlgorithm.ImportEncryptedPkcs8PrivateKey 메서드

정의

오버로드

ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)

바이트 기반 암호로 해독한 다음 이 개체의 키를 대체하여 PKCS#8 EncryptedPrivateKeyInfo 구조체에서 퍼블릭/프라이빗 키 쌍을 가져옵니다.

ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32)

바이트 기반 암호로 해독한 다음 이 개체의 키를 대체하여 PKCS#8 EncryptedPrivateKeyInfo 구조체에서 퍼블릭/프라이빗 키 쌍을 가져옵니다.

ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)

바이트 기반 암호로 해독한 다음 이 개체의 키를 대체하여 PKCS#8 EncryptedPrivateKeyInfo 구조체에서 퍼블릭/프라이빗 키 쌍을 가져옵니다.

public:
 override void ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<System::Byte> passwordBytes, ReadOnlySpan<System::Byte> source, [Runtime::InteropServices::Out] int % bytesRead);
public override void ImportEncryptedPkcs8PrivateKey (ReadOnlySpan<byte> passwordBytes, ReadOnlySpan<byte> source, out int bytesRead);
override this.ImportEncryptedPkcs8PrivateKey : ReadOnlySpan<byte> * ReadOnlySpan<byte> * int -> unit
Public Overrides Sub ImportEncryptedPkcs8PrivateKey (passwordBytes As ReadOnlySpan(Of Byte), source As ReadOnlySpan(Of Byte), ByRef bytesRead As Integer)

매개 변수

passwordBytes
ReadOnlySpan<Byte>

키 자료를 해독할 때 암호로 사용할 바이트입니다.

source
ReadOnlySpan<Byte>

ASN.1-BER 인코딩에 있는 PKCS#8 EncryptedPrivateKeyInfo 구조체의 바이트입니다.

bytesRead
Int32

이 메서드가 반환될 때 source에서 읽은 바이트 수를 나타내는 값을 포함합니다. 이 매개 변수는 초기화되지 않은 것으로 처리됩니다.

예외

암호가 잘못되었습니다.

또는

source의 콘텐츠에서는 적용할 KDF(키 파생 함수)가 char 기반 암호가 필요한 레거시 PKCS#12 KDF임을 나타냅니다.

또는

source의 콘텐츠에서 ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo 구조체를 나타내지 않습니다.

또는

source의 콘텐츠에서는 키가 이 인스턴스에서 표시하는 알고리즘 이외의 알고리즘용임을 나타냅니다.

또는

source의 콘텐츠는 지원되지 않는 형식의 키를 나타냅니다.

또는

알고리즘별 키 가져오기에 실패했습니다.

파생 클래스에 대한 ImportParameters(ECParameters)구현이 제공되지 않았습니다.

설명

The password bytes are passed directly into the Key Derivation Function (KDF) used by the algorithm indicated by the EncryptedPrivateKeyInfo 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).

          This method only supports the binary (BER/CER/DER) encoding of EncryptedPrivateKeyInfo.
          If the value is Base64-encoded, the caller must Base64-decode the contents before calling this method.
          If the contents are PEM-encoded, <xref:System.Security.Cryptography.ECAlgorithm.ImportFromEncryptedPem(System.ReadOnlySpan{System.Char},System.ReadOnlySpan{System.Byte})>
          should be used.

적용 대상

ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32)

바이트 기반 암호로 해독한 다음 이 개체의 키를 대체하여 PKCS#8 EncryptedPrivateKeyInfo 구조체에서 퍼블릭/프라이빗 키 쌍을 가져옵니다.

public:
 override void ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, ReadOnlySpan<System::Byte> source, [Runtime::InteropServices::Out] int % bytesRead);
public override void ImportEncryptedPkcs8PrivateKey (ReadOnlySpan<char> password, ReadOnlySpan<byte> source, out int bytesRead);
override this.ImportEncryptedPkcs8PrivateKey : ReadOnlySpan<char> * ReadOnlySpan<byte> * int -> unit
Public Overrides Sub ImportEncryptedPkcs8PrivateKey (password As ReadOnlySpan(Of Char), source As ReadOnlySpan(Of Byte), ByRef bytesRead As Integer)

매개 변수

password
ReadOnlySpan<Char>

키 자료를 암호 해독할 때 사용할 암호입니다.

source
ReadOnlySpan<Byte>

ASN.1-BER 인코딩에 있는 PKCS#8 EncryptedPrivateKeyInfo 구조체의 바이트입니다.

bytesRead
Int32

이 메서드가 반환될 때 source에서 읽은 바이트 수를 나타내는 값을 포함합니다. 이 매개 변수는 초기화되지 않은 것으로 처리됩니다.

예외

source의 콘텐츠에서 ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo 구조체를 나타내지 않습니다.

또는

source의 콘텐츠에서는 키가 이 인스턴스에서 표시하는 알고리즘 이외의 알고리즘용임을 나타냅니다.

또는

source의 콘텐츠는 지원되지 않는 형식의 키를 나타냅니다.

또는

알고리즘별 키 가져오기에 실패했습니다.

파생 클래스에 대한 ImportParameters(ECParameters)구현이 제공되지 않았습니다.

설명

When the contents of source 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.

          This method only supports the binary (BER/CER/DER) encoding of EncryptedPrivateKeyInfo.
          If the value is Base64-encoded, the caller must Base64-decode the contents before calling this method.
          If the contents are PEM-encoded, <xref:System.Security.Cryptography.ECAlgorithm.ImportFromEncryptedPem(System.ReadOnlySpan{System.Char},System.ReadOnlySpan{System.Char})>
          should be used.

적용 대상