CertificateChain Class
Namespace: Rebex.Security.Certificates
Assembly: Rebex.Common.dll (version 7.0.9083)
Represents a chain of certificates.
Syntax
public sealed class CertificateChain : IEnumerable<Certificate>, IEnumerable, IDisposable
Inherited Members
Remarks
A chain starts by the end certificate and each following certificate must directly certify the one preceding it. The last certificate in the list is a self-signed root certificate, and may be optionally omitted under the assumption it must be known in any case.
Constructors
Name | Description |
---|---|
CertificateChain() | Creates an empty certificate chain. |
CertificateChain(Certificate[]) | Creates a certificate chain from an array of certificates. |
Properties
Name | Description |
---|---|
Count | Gets the number of certificates in the chain. |
Item[Int32] | Gets or sets the certificate at the specified position. |
LeafCertificate | Gets the first certificate in the chain, if not empty. |
RootCertificate | Gets the certificate of the root certification authority, if available. |
Methods
Name | Description |
---|---|
Add(Certificate) | Adds a certificate to the end of the chain. This certificate represents authority for the previous certificate in the chain (Leaf certificate is at the beginning of the chain, Root certificate is at the end of the chain). |
BuildFrom(Certificate) | Builds a certificate chain for a specified certificate. |
BuildFrom(Certificate, CertificateChainEngine) | Builds a certificate chain for a specified certificate. |
BuildFrom(Certificate, CertificateStore) | Builds a certificate chain for a specified certificate. |
BuildFrom(Certificate, CertificateStore, CertificateChainEngine) | Builds a certificate chain for a specified certificate. |
Dispose() | Disposes the object. |
GetEnumerator() | Gets an IEnumerator<T> for the CertificateChain collection. |
LoadDer(String) | Loads a chain of Base-64-encoded X.509 certificates from the specified file. |
LoadP7b(Stream) | Loads a PKCS #7 (.p7b) encoded CertificateChain from the specified file. |
LoadP7b(String) | Loads CertificateChain from the specified PKCS #7 (.p7b) file. |
LoadPfx(Byte[], String) | Loads a certificate with a private key from a PKCS#12 (PFX) array. |
LoadPfx(Byte[], String, KeySetOptions) | Loads a certificate with a private key from a PKCS #12 (.p12/.pfx) array. |
LoadPfx(String, String) | Loads a certificate with a private key from a PKCS#12 (PFX) file. |
LoadPfx(String, String, KeySetOptions) | Loads a certificate with a private key from a PKCS#12 (PFX) file. |
Save(Stream) | Saves the certificate chain to the specified stream in .P7B (PKCS #7) format. |
Save(String) | Saves the certificate chain to the specified path as a .P7B (PKCS #7) file. |
Validate() | Verifies the validity of the certificate chain. |
Validate(ValidationOptions) | Verifies the validity of the certificate chain, including its compliance with the specified criteria. |
Validate(String, ValidationOptions) | Verifies the validity of the certificate chain, including its compliance with the specified criteria. |
Validate(String, ValidationOptions, CertificateChainEngine) | Verifies the validity of the certificate chain, including its compliance with the specified criteria, using the specified chain engine. |
VerifyHash(Byte[], SignatureHashAlgorithm, Byte[]) | Verifies the specified signature data by comparing it to the signature computed for the specified hash value. |
Explicit Interface Implementations
Name | Description |
---|---|
IEnumerable.GetEnumerator() | Returns an enumerator that can iterate through the CertificateChain |