Class PKCertificate
Inheritance
PKCertificate
Assembly: Lacuna.Pki.dll
Syntax
public class PKCertificate : Certificate
Constructors
PKCertificate(Byte[], Boolean, ICertificateStore)
Declaration
protected PKCertificate(byte[] certContent, bool fillChain, ICertificateStore certStore)
Parameters
Properties
DnsNames
SSL Certificate DNS Names
Declaration
public List<string> DnsNames { get; }
Property Value
EmailAddress
Declaration
public string EmailAddress { get; }
Property Value
ExtendedKeyUsage
The subject's extended key usage, or null if the extension is not present.
Declaration
public ExtendedKeyUsage? ExtendedKeyUsage { get; }
Property Value
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.
Declaration
public bool IsCA { get; }
Property Value
IsSelfSigned
Declaration
public override bool IsSelfSigned { get; }
Property Value
Overrides
IssuerDisplayName
Declaration
public override string IssuerDisplayName { get; }
Property Value
Overrides
IssuerDN
Declaration
protected override Name IssuerDN { get; }
Property Value
Overrides
IssuerName
The certificate's issuer name
Declaration
public Name IssuerName { get; protected set; }
Property Value
KeyUsage
The subject's key usage, or null if the KeyUsage extension is not present.
Declaration
public KeyUsage? KeyUsage { get; }
Property Value
PkiArgentina
Argentina PKI fields (INFRAESTRUCTURA DE FIRMA DIGITAL – REPÚBLICA ARGENTINA)
Declaration
public ArgentinaCertificateFields PkiArgentina { get; }
Property Value
PkiBrazil
Declaration
public IcpBrasilCertificateFields PkiBrazil { get; }
Property Value
PkiEcuador
Ecuador PKI common certificate fields among BCE (Banco Central Del Ecuador) and Security Data entities
Declaration
public EcuadorCertificateFields PkiEcuador { get; }
Property Value
PkiItaly
Declaration
public ItalyCertificateFields PkiItaly { get; }
Property Value
PkiParaguay
Declaration
public ParaguayCertificateFields PkiParaguay { get; }
Property Value
PkiPeru
Declaration
public PeruCertificateFields PkiPeru { get; }
Property Value
SubjectDisplayName
Declaration
public override string SubjectDisplayName { get; }
Property Value
Overrides
SubjectKeyIdentifier
Returns the bytes of the SubjectKeyIdentifier extension, or null if the extension is not present.
Declaration
public byte[] SubjectKeyIdentifier { get; }
Property Value
SubjectName
Declaration
public Name SubjectName { get; protected set; }
Property Value
SubjectPKAlgorithm
The public-key algorithm of the subject's public key
Declaration
public PKAlgorithm SubjectPKAlgorithm { get; protected set; }
Property Value
SubjectPublicKey
Declaration
public PublicKey SubjectPublicKey { get; protected set; }
Property Value
Methods
Decode(Byte[])
Decodes and creates a certificate object from certificate bytes BER, DER, Base64 or PEM encoded. Without loading the certificate chain.
Declaration
public static PKCertificate Decode(byte[] certContent)
Parameters
Type |
Name |
Description |
Byte[] |
certContent |
Certificate bytes BER, DER, Base64 or PEM encoded
|
Returns
Decode(Byte[], ICertificateStore)
Decodes and creates a certificate object from certificate bytes BER, DER, Base64 or PEM encoded. With certificate chain loading.
Declaration
public static PKCertificate Decode(byte[] certContent, ICertificateStore certStore)
Parameters
Type |
Name |
Description |
Byte[] |
certContent |
Certificate bytes BER, DER, Base64 or PEM encoded
|
ICertificateStore |
certStore |
Certificate store to assist the chain loading
|
Returns
Decode(String)
Decodes and creates a certificate object from certificate Base64 or PEM encoded. Without loading the certificate chain.
Declaration
public static PKCertificate Decode(string certContent)
Parameters
Type |
Name |
Description |
String |
certContent |
Certificate Base64 or PEM encoded
|
Returns
Decode(String, ICertificateStore)
Decodes and creates a certificate object from certificate Base64 or PEM encoded. With certificate chain loading.
Declaration
public static PKCertificate Decode(string certContent, ICertificateStore certStore)
Parameters
Type |
Name |
Description |
String |
certContent |
Certificate Base64 or PEM encoded
|
ICertificateStore |
certStore |
Certificate store to assist the chain loading
|
Returns
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.
Declaration
[Obsolete("Use PKCertificate.Decode(certContent) instead")]
public static PKCertificate DecodeWithoutChainLoading(byte[] certContent)
Parameters
Type |
Name |
Description |
Byte[] |
certContent |
Certificate bytes BER, DER, Base64 or PEM encoded
|
Returns
DecodeWithoutChainLoading(String)
Decodes and creates a certificate object without chain loading from certificate Base64 or PEM encoded. Without loading the certificate chain.
Declaration
[Obsolete("Use PKCertificate.Decode(certContent) instead")]
public static PKCertificate DecodeWithoutChainLoading(string certContent)
Parameters
Type |
Name |
Description |
String |
certContent |
Certificate Base64 or PEM encoded
|
Returns
GetCertificateChain()
Declaration
public List<PKCertificate> GetCertificateChain()
Returns
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.
Declaration
public byte[] GetOrGenerateSubjectKeyIdentifier()
Returns
GetSignatureCsp(DigestAlgorithm)
Declaration
public ISignatureCsp GetSignatureCsp(DigestAlgorithm digestAlgorithm)
Parameters
Returns
GetSignatureCsp(SignatureAlgorithm)
Declaration
public ISignatureCsp GetSignatureCsp(SignatureAlgorithm signatureAlgorithm)
Parameters
Returns
GetTbsCertificateEncoded()
Declaration
protected override byte[] GetTbsCertificateEncoded()
Returns
Overrides
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.
Declaration
Returns
Type |
Description |
Boolean |
Whether or not the certificate is a final CA
|
Exceptions
ToString()
Declaration
public override string ToString()
Returns
Overrides