Certificate Class
Namespace: Rebex.Security.Certificates
Assembly: Rebex.Common.dll (version 7.0.9083)
Represents an X.509 v3 certificate.
Syntax
public sealed class Certificate : IDisposable
Implements
Inherited Members
Constructors
Name | Description |
---|---|
Certificate(Byte[]) | Loads a certificate from an array. |
Certificate(IntPtr) | Creates a new instance of Certificate based on the specified context. |
Certificate(X509Certificate) | Creates a new instance of Certificate based on the specified certificate X509Certificate or X509Certificate2. |
Properties
Name | Description |
---|---|
Extensions | Gets the certificates extensions collection. |
FriendlyName | Gets or sets the friendly name associated with the certificate. |
Handle | Gets a handle of the certificate. |
KeyAlgorithm | Returns the key algorithm for this certificate. |
Tag | Gets or sets a custom object associated with this particular instance of Certificate. This value is not persisted. |
Thumbprint | Gets the thumbprint of the certificate. |
Methods
Name | Description |
---|---|
Associate(AsymmetricKeyAlgorithm) | Associates the supplied private key with the certificate to perform operations that need a private key. |
Associate(AsymmetricKeyAlgorithm, Boolean) | Associates the supplied private key with the certificate to perform operations that need a private key. |
Associate(PrivateKeyInfo) | Associates the supplied private key with the certificate to perform operations that need a private key. |
Associate(PrivateKeyInfo, Boolean) | Associates the supplied private key with the certificate to perform operations that need a private key. |
Associate(AsymmetricAlgorithm) | Associates the supplied private key with the certificate to perform operations that need a private key. |
Associate(AsymmetricAlgorithm, Boolean) | Associates the supplied private key with the certificate to perform operations that need a private key. |
Bind(AsymmetricKeyAlgorithm, CertificateKeyParameters) | Permanently binds the supplied private key with the certificate. Only supported on Windows. |
Bind(PrivateKeyInfo, CertificateKeyParameters) | Permanently binds the supplied private key with the certificate. Only supported on Windows. |
Bind(AsymmetricAlgorithm, CertificateKeyParameters) | Permanently binds the supplied private key with the certificate. Only supported on Windows. |
Decrypt(Byte[], Boolean) | Decrypts data. |
Dispose() | Disposes the object and releases resources. |
Encrypt(Byte[]) | Encrypts data. |
GetAuthorityKeyIdentifier() | Returns the certificate's issuer key identifier (AKI). |
GetCertHash() | Returns the hash value for the X.509v3 certificate as an array of bytes. |
GetCommonName() | Returns the certificate's common name, if available. |
GetCommonNames() | Returns the list of certificate's common names. |
GetCrlDistributionPoints() | Returns the collection of CRL distribution points. |
GetDSAParameters() | Returns the DSA parameters of certificate's public key. |
GetDSAParameters(Boolean, Boolean) | Returns the DSA parameters of certificate's public or private key. True if private key parameters are to be exported as well. If set to true, the cryptographic provider should not display any user interface (UI) when exporting private key parameters. |
GetEffectiveDate() | Returns the effective date of this X.509v3 certificate (in local time). |
GetEnhancedUsage() | Returns an array of enhanced key usage identifiers. |
GetExpirationDate() | Returns the expiration date of this X.509v3 certificate (in local time). |
GetIntendedUsage() | Returns the intended key usage value. |
GetIssuer() | Returns the DN of the certification authority that issued the X.509v3 certificate. |
GetIssuerName() | Returns the name of the certification authority that issued the X.509v3 certificate. |
GetKeyAlgorithmParameters() | Returns the key algorithm parameters for the X.509v3 certificate. |
GetKeySize() | Returns the size of the key in bits. |
GetMailAddresses() | Returns the list of certificate's e-mail addresses. |
GetPrivateKeyAlgorithm(Boolean) | Gets the private key algorithm for this certificate. |
GetPrivateKeyInfo(Boolean) | Returns the private key info for the X.509v3 certificate. |
GetPublicKey() | Returns the public key for the X.509v3 certificate. |
GetPublicKeyAlgorithm() | Gets the public key algorithm for this certificate. |
GetPublicKeyInfo() | Returns the public key info for the X.509v3 certificate. |
GetRawCertData() | Returns the raw data for the entire X.509v3 certificate. |
GetRSAParameters() | Returns the RSA parameters of certificate's public key. |
GetRSAParameters(Boolean, Boolean) | Returns the RSA parameters of certificate's public or private key. |
GetSerialNumber() | Returns the serial number of the X.509v3 certificate. |
GetSignatureHashAlgorithm() | Returns the hash algorithm used to create the signature of this certificate. |
GetSubject() | Returns DN of the principal to which the certificate was issued. |
GetSubjectKeyIdentifier() | Returns the certificate's subject key identifier (SKI). |
GetSubjectName() | Returns the name of the principal to which the certificate was issued. |
HasPrivateKey() | Checks whether a private key for this certificate is available. |
IsTimeValid() | Checks whether a certificate is time valid. |
LoadDer(Stream) | Loads a DER encoded certificate from the specified stream. |
LoadDer(String) | Loads a DER encoded certificate from the specified file. |
LoadDerWithKey(Stream, Stream, String) | Loads a DER encoded certificate and a private key (in PKCS #8, PuTTY or SSLeay format) from the specified streams. |
LoadDerWithKey(String, String, String) | Loads a DER encoded certificate and a private key (in PKCS #8, PuTTY or SSLeay format) from the specified files. |
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 (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 to the supplied stream in DER format. |
Save(Stream, CertificateFormat) | Saves the certificate to the supplied stream in specified format. |
Save(Stream, CertificateFormat, String) | Saves the certificate to the supplied stream in specified format. |
Save(String) | Saves the certificate to the supplied file in DER format. |
Save(String, CertificateFormat) | Saves the certificate to the supplied file in specified format. |
Save(String, CertificateFormat, String) | Saves the certificate to the supplied file in specified format. |
SavePrivateKey(Stream, String, PrivateKeyFormat, Boolean) | Saves the certificate's private key to the supplied stream. |
SavePrivateKey(String, String, PrivateKeyFormat, Boolean) | Saves the certificate's private key to the supplied file. |
SignHash(Byte[], SignatureHashAlgorithm, Boolean) | Computes the signature for the specified hash value by encrypting it with the private key. |
SignMessage(Byte[]) | Computes the signature for the specified message by encrypting it with the private key. |
SignMessage(Byte[], SignatureParameters) | Computes the signature for the specified message by encrypting it with the private key. |
Validate() | Verifies the validity of the certificate. |
Validate(ValidationOptions) | Verifies the validity of the certificate, including its compliance with the specified criteria. |
Validate(String, ValidationOptions) | Verifies the validity of the certificate, including its compliance with the specified criteria. |
Validate(String, ValidationOptions, CertificateChainEngine) | Verifies the validity of the certificate, including its compliance with the specified criteria, using the specified chain engine. |
ValidateRevocationList(CertificateRevocationList, Nullable<DateTime>) | Validates the specified certificate revocation list (issued by this certificate). |
VerifyHash(Byte[], SignatureHashAlgorithm, Byte[]) | Verifies the specified signature data by comparing it to the signature computed for the specified hash value. |
VerifyMessage(Byte[], Byte[]) | Verifies the specified signature data by comparing it to the signature computed for the specified message. |
VerifyMessage(Byte[], Byte[], SignatureParameters) | Verifies the specified signature data by comparing it to the signature computed for the specified message. |
Operators
Name | Description |
---|---|
Implicit(Certificate to X509Certificate2) | Converts a Certificate to X509Certificate2 (or X509Certificate). |
Implicit(X509Certificate to Certificate) | Converts an X509Certificate or X509Certificate2 to a Certificate. |