Pular para o conteúdo principal

PrivateKey

Namespace: Lacuna.Pki
Assembly: Lacuna.Pki
Class

public abstract class PrivateKey : IPrivateKey

Hierarquia: objectPrivateKey

Construtores

PrivateKey()

protected PrivateKey()

Propriedades

Algorithm

public abstract PKAlgorithm Algorithm { get; }

Retorno

PKAlgorithm


Métodos

Decode(byte[], string)

Decodes encrypted private key from ASN1 DER content or PEM file content

public static PrivateKey Decode(byte[] content, string password)

Parâmetros

NomeTipoDescrição
contentbyte[]
passwordstring

Retorno

PrivateKey


Decode(byte[])

Decodes private key from ASN1 DER content or PEM file content

public static PrivateKey Decode(byte[] content)

Parâmetros

NomeTipoDescrição
contentbyte[]

Retorno

PrivateKey


Decode(string, string)

Decodes encrypted private key from PEM string or ASN1 DER base64 string

public static PrivateKey Decode(string pem, string password)

Parâmetros

NomeTipoDescrição
pemstring
passwordstring

Retorno

PrivateKey


Decode(string)

Decodes private key from PEM string or ASN1 DER base64 string

public static PrivateKey Decode(string pem)

Parâmetros

NomeTipoDescrição
pemstring

Retorno

PrivateKey


Export()

Returns the DER-encoded (unencrypted) private key (PKCS #8)

public byte[] Export()

Retorno

byte[]

Comentários

Not all private keys are exportable. For such keys, an exception will be thrown.


ExportPem()

Returns the PEM-encoded (unencrypted) private key (PKCS #8)

public string ExportPem()

Retorno

string

Comentários

Not all private keys are exportable. For such keys, an exception will be thrown.


GetEncryptionCsp()

public abstract IEncryptionCsp GetEncryptionCsp()

Retorno

IEncryptionCsp


GetInstance(AsymmetricAlgorithm)

public static PrivateKey GetInstance(AsymmetricAlgorithm underlyingPrivateKey)

Parâmetros

NomeTipoDescrição
underlyingPrivateKeyAsymmetricAlgorithm

Retorno

PrivateKey


GetInstance(X509Certificate2)

public static IPrivateKey GetInstance(X509Certificate2 x509Certificate)

Parâmetros

NomeTipoDescrição
x509CertificateX509Certificate2

Retorno

IPrivateKey


GetSignatureCsp(DigestAlgorithm)

public abstract ISignatureCsp GetSignatureCsp(DigestAlgorithm digestAlgorithm)

Parâmetros

NomeTipoDescrição
digestAlgorithmDigestAlgorithm

Retorno

ISignatureCsp


Membros herdados

ToString(), Equals(object), Equals(object, object), ReferenceEquals(object, object), GetHashCode(), GetType(), MemberwiseClone()