Class Certificate<TCertificate, TFingerprint>
A certificate to be used for secure communication.
Inherited Members
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public abstract class Certificate<TCertificate, TFingerprint>
where TCertificate : Certificate<TCertificate, TFingerprint> where TFingerprint : Fingerprint
Type Parameters
Name | Description |
---|---|
TCertificate | |
TFingerprint |
Constructors
Certificate()
Initializes a new instance of the Certificate<TCertificate, TFingerprint> class.
Declaration
public Certificate()
Properties
AutoRegenerate
Gets or sets whether the certificate's cryptography data should be automatically regenerated when it is about to expire. Defaults to
true
.
Declaration
public bool AutoRegenerate { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
EffectiveDate
Gets the effective date.
Declaration
public DateTime EffectiveDate { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
ExpirationDate
Gets the expiration date.
Declaration
public DateTime ExpirationDate { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
Id
Gets or sets the identifier.
Declaration
public string Id { get; set; }
Property Value
Type | Description |
---|---|
System.String |
IsExpired
Gets whether the certificate is expired.
Declaration
public bool IsExpired { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsExpiring
Gets whether the certificate is expiring within 24 hours.
Declaration
public bool IsExpiring { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsSealed
Gets a value indicating whether this certificate is sealed and can no longer be modified.
Declaration
public bool IsSealed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IssuerName
Gets the name of the issuer.
Declaration
public string IssuerName { get; }
Property Value
Type | Description |
---|---|
System.String |
Key
Gets or sets the asymmetric key.
Declaration
public AsymmetricKey Key { get; set; }
Property Value
Type | Description |
---|---|
AsymmetricKey |
SubjectName
Gets the name of the subject.
Declaration
public string SubjectName { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
CalculateFingerprint(String)
Calculates a fingerprint for this certificate.
Declaration
public TFingerprint CalculateFingerprint(string algorithm)
Parameters
Type | Name | Description |
---|---|---|
System.String | algorithm | The algorithm. |
Returns
Type | Description |
---|---|
TFingerprint |
Clone()
Clones this instance.
Declaration
public TCertificate Clone()
Returns
Type | Description |
---|---|
TCertificate |
CreateCertificate()
Creates a certificate.
Declaration
protected abstract TCertificate CreateCertificate()
Returns
Type | Description |
---|---|
TCertificate |
CreateFingerprint(String, String)
Creates a fingerprint.
Declaration
protected abstract TFingerprint CreateFingerprint(string algorithm, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | algorithm | The algorithm. |
System.String | value | The value. |
Returns
Type | Description |
---|---|
TFingerprint |
GetBuffer()
Serializes this certificate to binary.
Declaration
public DataBuffer GetBuffer()
Returns
Type | Description |
---|---|
DataBuffer |
GetBytes()
Serializes this certificate to binary.
Declaration
public byte[] GetBytes()
Returns
Type | Description |
---|---|
System.Byte[] |
Regenerate()
Regenerates the certificate's cryptography data using an expiration date of 10 days from now.
Declaration
public void Regenerate()
Regenerate(DateTime)
Regenerates the certificate's cryptography data using the given expiration date.
Declaration
public void Regenerate(DateTime expirationDate)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | expirationDate | The expiration date. |
ToX509Certificate2()
Converts this instance into an System.Security.Cryptography.X509Certificates.X509Certificate2.
Declaration
public X509Certificate2 ToX509Certificate2()
Returns
Type | Description |
---|---|
System.Security.Cryptography.X509Certificates.X509Certificate2 |