Class Certificate
- Namespace
- Fluxzy.Certificates
- Assembly
- Fluxzy.Core.dll
Holds information about an X509 certificate configuration
public class Certificate
- Inheritance
-
Certificate
- Inherited Members
Constructors
Certificate()
[JsonConstructor]
[Obsolete("This constructor is for serialization only (System.Text.Json limitation). Use static methods instead to avoid misconfiguration.")]
public Certificate()
Properties
Pkcs12File
The certificate file when location type is FromPkcs12
[JsonInclude]
public string? Pkcs12File { get; set; }
Property Value
Pkcs12Password
The certificate password when location typ is FromPkcs12. Null with no password was set.
[JsonInclude]
public string? Pkcs12Password { get; set; }
Property Value
RetrieveMode
Defines how to retrieve the certificate
[JsonInclude]
public CertificateRetrieveMode RetrieveMode { get; set; }
Property Value
SerialNumber
The certificate serial number when location type is FromUserStoreSerialNumber
[JsonInclude]
public string? SerialNumber { get; set; }
Property Value
ThumbPrint
The certificate thumb print when location type is FromUserStoreSerialNumber
[JsonInclude]
public string? ThumbPrint { get; set; }
Property Value
Methods
Equals(Certificate)
Check if the certificate is equal to another certificate. Don't use this method to check if the certificate is the same
protected bool Equals(Certificate other)
Parameters
other
Certificate
Returns
Equals(object?)
Check if the certificate is equal to another certificate. Don't use this method to check if the certificate is the same
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
GetX509Certificate()
Retrieve the current certificate as X509Certificate2
public X509Certificate2 GetX509Certificate()
Returns
Exceptions
LoadFromPkcs12(string)
Create a new instance from a PCKS12 file
public static Certificate LoadFromPkcs12(string pkcs12File)
Parameters
pkcs12File
string
Returns
LoadFromPkcs12(string, string)
Create a new instance from a PCKS12 file with a password
public static Certificate LoadFromPkcs12(string pkcs12File, string pkcs12Password)
Parameters
Returns
LoadFromUserStoreBySerialNumber(string)
Create a new instance from a certificate in the current user store by its serialNumber
public static Certificate LoadFromUserStoreBySerialNumber(string serialNumber)
Parameters
serialNumber
string
Returns
LoadFromUserStoreByThumbprint(string)
Create a new instance from a certificate in the current user store by its thumbprint
public static Certificate LoadFromUserStoreByThumbprint(string thumbPrint)
Parameters
thumbPrint
string
Returns
UseDefault()
Get the default built-in fluxzy certificate
public static Certificate UseDefault()