PKCertificate
Namespace: Lacuna.Pki
Assembly: Lacuna.Pki
Class
public class PKCertificate : Certificate
Hierarquia: object → Certificate → PKCertificate
Construtores
PKCertificate(byte[], bool, ICertificateStore)
protected PKCertificate(byte[] certContent, bool fillChain, ICertificateStore certStore)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
certContent | byte[] | |
fillChain | bool | |
certStore | ICertificateStore |
Propriedades
DnsNames
SSL Certificate DNS Names
public List<string> DnsNames { get; }
Retorno
EmailAddress
public string EmailAddress { get; }
Retorno
ExtendedKeyUsage
The subject's extended key usage, or null if the extension is not present.
public ExtendedKeyUsage? ExtendedKeyUsage { get; }
Retorno
ExtendedKeyUsage?
IsCA
Denotes whether this certificate is a Certification Authority certificate, that is, if it may be used to verify certificate signatures, as defined in RFC 5280 item 4.2.1.9.
public bool IsCA { get; }
Retorno
IsSelfSigned
Denotes whether this is a self-signed certificate (root certificate) or not.
NOTICE: never test the condition Issuer==null to assertain if a certificate is self-signed, since that condition may throw an exception in case the certificate is not a self-signed certificate but its issuer could not be located. For such purposes, use this property instead.
public override bool IsSelfSigned { get; }
Retorno
IssuerDisplayName
public override string IssuerDisplayName { get; }
Retorno
IssuerDN
protected override Name IssuerDN { get; }
Retorno
IssuerName
The certificate's issuer name
public Name IssuerName { get; protected set; }
Retorno
KeyUsage
The subject's key usage, or null if the KeyUsage extension is not present.
public KeyUsage? KeyUsage { get; }
Retorno
KeyUsage?
PkiArgentina
Argentina PKI fields (INFRAESTRUCTURA DE FIRMA DIGITAL – REPÚBLICA ARGENTINA)
public ArgentinaCertificateFields PkiArgentina { get; }
Retorno
PkiBrazil
Brazil PKI fields
public IcpBrasilCertificateFields PkiBrazil { get; }
Retorno
PkiEcuador
Ecuador PKI common certificate fields among BCE (Banco Central Del Ecuador) and Security Data entities
public EcuadorCertificateFields PkiEcuador { get; }
Retorno
PkiItaly
Italy PKI fields
public ItalyCertificateFields PkiItaly { get; }
Retorno
PkiParaguay
Paraguay PKI fields
public ParaguayCertificateFields PkiParaguay { get; }
Retorno
PkiPeru
Peru PKI fields
public PeruCertificateFields PkiPeru { get; }
Retorno
SubjectDisplayName
public override string SubjectDisplayName { get; }
Retorno
SubjectKeyIdentifier
Returns the bytes of the SubjectKeyIdentifier extension, or null if the extension is not present.
public byte[] SubjectKeyIdentifier { get; }
Retorno
SubjectName
The subject's name
public Name SubjectName { get; protected set; }
Retorno
SubjectPKAlgorithm
The public-key algorithm of the subject's public key
public PKAlgorithm SubjectPKAlgorithm { get; protected set; }
Retorno
SubjectPublicKey
The subject's public key
public PublicKey SubjectPublicKey { get; protected set; }
Retorno
Métodos
Decode(byte[], ICertificateStore)
Decodes and creates a certificate object from certificate bytes BER, DER, Base64 or PEM encoded. With certificate chain loading.
public static PKCertificate Decode(byte[] certContent, ICertificateStore certStore)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
certContent | byte[] | Certificate bytes BER, DER, Base64 or PEM encoded |
certStore | ICertificateStore | Certificate store to assist the chain loading |
Retorno
PKCertificate — PKCertificate object
Decode(byte[])
Decodes and creates a certificate object from certificate bytes BER, DER, Base64 or PEM encoded. Without loading the certificate chain.
public static PKCertificate Decode(byte[] certContent)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
certContent | byte[] | Certificate bytes BER, DER, Base64 or PEM encoded |
Retorno
PKCertificate — PKCertificate object
Decode(string, ICertificateStore)
Decodes and creates a certificate object from certificate Base64 or PEM encoded. With certificate chain loading.
public static PKCertificate Decode(string certContent, ICertificateStore certStore)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
certContent | string | Certificate Base64 or PEM encoded |
certStore | ICertificateStore | Certificate store to assist the chain loading |
Retorno
PKCertificate — PKCertificate object
Decode(string)
Decodes and creates a certificate object from certificate Base64 or PEM encoded. Without loading the certificate chain.
public static PKCertificate Decode(string certContent)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
certContent | string | Certificate Base64 or PEM encoded |
Retorno
PKCertificate — PKCertificate object
DecodeWithoutChainLoading(byte[])
Decodes and creates a certificate object without chain loading from certificate bytes BER, DER, Base64 or PEM encoded. Without loading the certificate chain.
[Obsolete("Use PKCertificate.Decode(certContent) instead")]
public static PKCertificate DecodeWithoutChainLoading(byte[] certContent)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
certContent | byte[] | Certificate bytes BER, DER, Base64 or PEM encoded |
Retorno
PKCertificate — PKCertificate object
DecodeWithoutChainLoading(string)
Decodes and creates a certificate object without chain loading from certificate Base64 or PEM encoded. Without loading the certificate chain.
[Obsolete("Use PKCertificate.Decode(certContent) instead")]
public static PKCertificate DecodeWithoutChainLoading(string certContent)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
certContent | string | Certificate Base64 or PEM encoded |
Retorno
PKCertificate — PKCertificate object
GetCertificateChain()
public List<PKCertificate> GetCertificateChain()
Retorno
GetOrGenerateSubjectKeyIdentifier()
If the certificate contains a Subject Key Identifier extension, returns the value of the key identifier. Otherwise, generates a key identifier using the SHA-1 digest algorithm, as specified in RFC 5280. NOTE: in some cases, one must only reference a certificate by its SubjectKeyIdentifier if the EXTENSION is present. If such cases, use the property SubjectKeyIdentifier instead, that returns a value only if the extension is present.
public byte[] GetOrGenerateSubjectKeyIdentifier()
Retorno
GetSignatureCsp(DigestAlgorithm)
public ISignatureCsp GetSignatureCsp(DigestAlgorithm digestAlgorithm)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
digestAlgorithm | DigestAlgorithm |
Retorno
GetSignatureCsp(SignatureAlgorithm)
public ISignatureCsp GetSignatureCsp(SignatureAlgorithm signatureAlgorithm)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
signatureAlgorithm | SignatureAlgorithm |
Retorno
GetTbsCertificateEncoded()
protected override byte[] GetTbsCertificateEncoded()
Retorno
IsFinalCA()
Returns whether or not the certificate is a final CA. That is, if the certificate is a CA that can issue end entities certificates only. This method may require certificate chain loading, which can throw exceptions.
public bool IsFinalCA()
Retorno
bool — Whether or not the certificate is a final CA
Exceções
| Tipo | Condição |
|---|---|
InvalidOperationException | Thrown when the current certificate is not a CA |
CertificateIssuerNotFoundException | Thrown when certificate chain loading is required but fails |
CertificateChainException | Thrown when the certificate chain does not have a valid path length |
ToString()
public override string ToString()
Retorno
Membros herdados
issuer, Validate(ITrustArbitrator), Validate(CertificateValidationOptions), TryFillIssuer(ICertificateStore), Equals(object), GetHashCode(), EncodedValue, ValidityStart, ValidityEnd, SignatureValue, SerialNumber, Extensions, SignatureAlgorithm, Issuer, IssuerFound, IssuerNotFound, TrustAnchor, TbsCertificateEncoded, ThumbprintSHA1, ThumbprintSHA256, AuthorityInformationAccess, CAIssuersUri, OcspUri, IssuerKeyIdentifier, Equals(object, object), ReferenceEquals(object, object), GetType(), MemberwiseClone()