RSA.ImportFromEncryptedPem Método
Definição
Sobrecargas
| ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Byte>) |
Importa uma chave privada criptografada no formato PEM conforme RFC 7468, substituindo as chaves do objeto.Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object. |
| ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Char>) |
Importa uma chave privada criptografada no formato PEM conforme RFC 7468, substituindo as chaves do objeto.Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object. |
ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Byte>)
Importa uma chave privada criptografada no formato PEM conforme RFC 7468, substituindo as chaves do objeto.Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object.
public:
override void ImportFromEncryptedPem(ReadOnlySpan<char> input, ReadOnlySpan<System::Byte> passwordBytes);
public override void ImportFromEncryptedPem (ReadOnlySpan<char> input, ReadOnlySpan<byte> passwordBytes);
override this.ImportFromEncryptedPem : ReadOnlySpan<char> * ReadOnlySpan<byte> -> unit
Public Overrides Sub ImportFromEncryptedPem (input As ReadOnlySpan(Of Char), passwordBytes As ReadOnlySpan(Of Byte))
Parâmetros
- input
- ReadOnlySpan<Char>
Texto no formato PEM da chave criptografada a ser importada.The PEM text of the encrypted key to import.
- passwordBytes
- ReadOnlySpan<Byte>
Os bytes a serem usados como senha ao descriptografar o material da chave.The bytes to use as a password when decrypting the key material.
Exceções
input não contém uma chave codificada no formato PEM com um rótulo reconhecido.input does not contain a PEM-encoded key with a recognized label.
- ou --or-
input contém várias chaves codificadas no formato PEM com um rótulo reconhecido.input contains multiple PEM-encoded keys with a recognized label.
A senha está incorreta.The password is incorrect.
- ou --or-
O conteúdo decodificado em base 64 do texto no formato PEM proveniente de input não representa uma estrutura EncryptedPrivateKeyInfo PKCS#8 codificada por ASN.1-BER.The base-64 decoded contents of the PEM text from input do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure.
- ou --or-
O conteúdo decodificado em base 64 do texto no formato PEM proveniente de input indica que a chave é destinada a um algoritmo diferente do representado pela instância.The base-64 decoded contents of the PEM text from input indicate the key is for an algorithm other than the algorithm represented by this instance.
- ou --or-
O conteúdo decodificado em base 64 do texto no formato PEM proveniente de input representa a chave em um formato sem suporte.The base-64 decoded contents of the PEM text from input represent the key in a format that is not supported.
- ou --or-
Falha na importação da chave específica do algoritmo.The algorithm-specific key import failed.
Comentários
Os bytes de senha são passados diretamente para a função de derivação de chave (KDF) usada pelo algoritmo indicado por pbeParameters .The password bytes are passed directly into the Key Derivation Function (KDF) used by the algorithm indicated by pbeParameters. Isso permite a compatibilidade com outros sistemas que usam uma codificação de texto diferente de UTF-8 durante o processamento de senhas com PBKDF2 (função de derivação de chave baseada em senha 2).This enables compatibility with other systems that use a text encoding other than UTF-8 when processing passwords with PBKDF2 (Password-Based Key Derivation Function 2).
Objetos codificados por PEM sem suporte ou malformados serão ignorados.Unsupported or malformed PEM-encoded objects will be ignored. Se vários rótulos PEM com suporte forem encontrados, uma exceção será lançada para impedir a importação de uma chave quando a chave for ambígua.If multiple supported PEM labels are found, an exception is thrown to prevent importing a key when the key is ambiguous.
Este método dá suporte ao ENCRYPTED PRIVATE KEY rótulo PEM.This method supports the ENCRYPTED PRIVATE KEY PEM label.
Aplica-se a
ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Char>)
Importa uma chave privada criptografada no formato PEM conforme RFC 7468, substituindo as chaves do objeto.Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object.
public:
override void ImportFromEncryptedPem(ReadOnlySpan<char> input, ReadOnlySpan<char> password);
public override void ImportFromEncryptedPem (ReadOnlySpan<char> input, ReadOnlySpan<char> password);
override this.ImportFromEncryptedPem : ReadOnlySpan<char> * ReadOnlySpan<char> -> unit
Public Overrides Sub ImportFromEncryptedPem (input As ReadOnlySpan(Of Char), password As ReadOnlySpan(Of Char))
Parâmetros
- input
- ReadOnlySpan<Char>
Texto no formato PEM da chave criptografada a ser importada.The PEM text of the encrypted key to import.
- password
- ReadOnlySpan<Char>
A senha a ser usada para descriptografar o material da chave.The password to use for decrypting the key material.
Exceções
input não contém uma chave codificada no formato PEM com um rótulo reconhecido.input does not contain a PEM-encoded key with a recognized label.
- ou --or-
input contém várias chaves codificadas no formato PEM com um rótulo reconhecido.input contains multiple PEM-encoded keys with a recognized label.
A senha está incorreta.The password is incorrect.
- ou --or-
O conteúdo decodificado em base 64 do texto no formato PEM proveniente de input não representa uma estrutura EncryptedPrivateKeyInfo PKCS#8 codificada por ASN.1-BER.The base-64 decoded contents of the PEM text from input do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure.
- ou --or-
O conteúdo decodificado em base 64 do texto no formato PEM proveniente de input indica que a chave é destinada a um algoritmo diferente do representado pela instância.The base-64 decoded contents of the PEM text from input indicate the key is for an algorithm other than the algorithm represented by this instance.
- ou --or-
O conteúdo decodificado em base 64 do texto no formato PEM proveniente de input representa a chave em um formato sem suporte.The base-64 decoded contents of the PEM text from input represent the key in a format that is not supported.
- ou --or-
Falha na importação da chave específica do algoritmo.The algorithm-specific key import failed.
Comentários
Quando o conteúdo de base-64 decodificado input indica um algoritmo que usa PBKDF1 (função de derivação de chave baseada em senha 1) ou PBKDF2 (função de derivação de chave baseada em senha 2), a senha é convertida em bytes por meio da codificação UTF-8.When the base-64 decoded contents of input 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.
Objetos codificados por PEM sem suporte ou malformados serão ignorados.Unsupported or malformed PEM-encoded objects will be ignored. Se vários rótulos PEM com suporte forem encontrados, uma exceção será lançada para impedir a importação de uma chave quando a chave for ambígua.If multiple supported PEM labels are found, an exception is thrown to prevent importing a key when the key is ambiguous.
Este método dá suporte ao ENCRYPTED PRIVATE KEY rótulo PEM.This method supports the ENCRYPTED PRIVATE KEY PEM label.