Class TlsCertificate
A certificate to be used for TLS communication.
Inherited Members
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class TlsCertificate : Certificate<TlsCertificate, TlsFingerprint>
Properties
DefaultKeyType
Gets or sets the default asymmetric key type (RSA).
Declaration
public static AsymmetricKeyType DefaultKeyType { get; set; }
Property Value
Type | Description |
---|---|
AsymmetricKeyType |
Methods
CreateCertificate()
Creates the certificate.
Declaration
protected override TlsCertificate CreateCertificate()
Returns
Type | Description |
---|---|
TlsCertificate |
Overrides
CreateFingerprint(String, String)
Creates a fingerprint.
Declaration
protected override TlsFingerprint CreateFingerprint(string algorithm, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | algorithm | The algorithm. |
System.String | value | The value. |
Returns
Type | Description |
---|---|
TlsFingerprint |
Overrides
FromX509Certificate2(X509Certificate2)
Converts an
Declaration
public static TlsCertificate FromX509Certificate2(X509Certificate2 x509Certificate2)
Parameters
Type | Name | Description |
---|---|---|
X509Certificate2 | x509Certificate2 |
Returns
Type | Description |
---|---|
TlsCertificate |
GenerateCertificate()
Generates a certificate with a default issuer/subject name and an expiration date of 10 days from now.
Declaration
public static TlsCertificate GenerateCertificate()
Returns
Type | Description |
---|---|
TlsCertificate |
GenerateCertificate(AsymmetricKey)
Generates a certificate with a default issuer/subject name and an expiration date of 10 days from now.
Declaration
public static TlsCertificate GenerateCertificate(AsymmetricKey key)
Parameters
Type | Name | Description |
---|---|---|
AsymmetricKey | key | The asymmetric key (with public and private details). |
Returns
Type | Description |
---|---|
TlsCertificate |
GenerateCertificate(AsymmetricKeyType)
Generates a certificate with a default issuer/subject name and an expiration date of 10 days from now.
Declaration
public static TlsCertificate GenerateCertificate(AsymmetricKeyType keyType)
Parameters
Type | Name | Description |
---|---|---|
AsymmetricKeyType | keyType | The asymmetric key type. |
Returns
Type | Description |
---|---|
TlsCertificate |
GenerateCertificate(String)
Generates a certificate with the given issuer/subject name and an expiration date of 10 days from now.
Declaration
public static TlsCertificate GenerateCertificate(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the issuer/subject. |
Returns
Type | Description |
---|---|
TlsCertificate |
GenerateCertificate(String, AsymmetricKey)
Generates a certificate with the given issuer/subject name and an expiration date of 10 days from now.
Declaration
public static TlsCertificate GenerateCertificate(string name, AsymmetricKey key)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the issuer/subject. |
AsymmetricKey | key | The asymmetric key (with public and private details). |
Returns
Type | Description |
---|---|
TlsCertificate |
GenerateCertificate(String, AsymmetricKeyType)
Generates a certificate with the given issuer/subject name and an expiration date of 10 days from now.
Declaration
public static TlsCertificate GenerateCertificate(string name, AsymmetricKeyType keyType)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the issuer/subject. |
AsymmetricKeyType | keyType | The asymmetric key type. |
Returns
Type | Description |
---|---|
TlsCertificate |
GenerateCertificate(String, String)
Generates a certificate with the given issuer name, subject name, and an expiration date of 10 days from now.
Declaration
public static TlsCertificate GenerateCertificate(string issuerName, string subjectName)
Parameters
Type | Name | Description |
---|---|---|
System.String | issuerName | The name of the issuer. |
System.String | subjectName | The name of the subject. |
Returns
Type | Description |
---|---|
TlsCertificate |
GenerateCertificate(String, String, DateTime)
Generates a certificate with the given issuer name, subject name, and expiration date.
Declaration
public static TlsCertificate GenerateCertificate(string issuerName, string subjectName, DateTime expirationDate)
Parameters
Type | Name | Description |
---|---|---|
System.String | issuerName | The name of the issuer. |
System.String | subjectName | The name of the subject. |
DateTime | expirationDate | The expiration date. |
Returns
Type | Description |
---|---|
TlsCertificate |
GenerateCertificate(String, String, DateTime, AsymmetricKey)
Generates a certificate with the given issuer name, subject name, expiration date, and asymmetric key.
Declaration
public static TlsCertificate GenerateCertificate(string issuerName, string subjectName, DateTime expirationDate, AsymmetricKey key)
Parameters
Type | Name | Description |
---|---|---|
System.String | issuerName | The name of the issuer. |
System.String | subjectName | The name of the subject. |
DateTime | expirationDate | The expiration date. |
AsymmetricKey | key | The asymmetric key (with public and private details). |
Returns
Type | Description |
---|---|
TlsCertificate |
GenerateCertificate(String, String, DateTime, AsymmetricKeyType)
Generates a certificate with the given issuer name, subject name, expiration date, and asymmetric key.
Declaration
public static TlsCertificate GenerateCertificate(string issuerName, string subjectName, DateTime expirationDate, AsymmetricKeyType keyType)
Parameters
Type | Name | Description |
---|---|---|
System.String | issuerName | The name of the issuer. |
System.String | subjectName | The name of the subject. |
DateTime | expirationDate | The expiration date. |
AsymmetricKeyType | keyType | The asymmetric key type. |
Returns
Type | Description |
---|---|
TlsCertificate |
GenerateCertificate(String, String, AsymmetricKey)
Generates a certificate with the given issuer name, subject name, and an expiration date of 10 days from now.
Declaration
public static TlsCertificate GenerateCertificate(string issuerName, string subjectName, AsymmetricKey key)
Parameters
Type | Name | Description |
---|---|---|
System.String | issuerName | The name of the issuer. |
System.String | subjectName | The name of the subject. |
AsymmetricKey | key | The asymmetric key (with public and private details). |
Returns
Type | Description |
---|---|
TlsCertificate |
GenerateCertificate(String, String, AsymmetricKeyType)
Generates a certificate with the given issuer name, subject name, and an expiration date of 10 days from now.
Declaration
public static TlsCertificate GenerateCertificate(string issuerName, string subjectName, AsymmetricKeyType keyType)
Parameters
Type | Name | Description |
---|---|---|
System.String | issuerName | The name of the issuer. |
System.String | subjectName | The name of the subject. |
AsymmetricKeyType | keyType | The asymmetric key type. |
Returns
Type | Description |
---|---|
TlsCertificate |
GenerateCertificateFromOldCertificate(TlsCertificate)
Generates a certificate using the issuer/subject name from an old certificate and an expiration date of 10 days from now.
Declaration
public static TlsCertificate GenerateCertificateFromOldCertificate(TlsCertificate oldCertificate)
Parameters
Type | Name | Description |
---|---|---|
TlsCertificate | oldCertificate | The old certificate. |
Returns
Type | Description |
---|---|
TlsCertificate |
GenerateCertificateFromOldCertificate(TlsCertificate, DateTime)
Generates a certificate using the issuer/subject name from an old certificate and the given expiration date.
Declaration
public static TlsCertificate GenerateCertificateFromOldCertificate(TlsCertificate oldCertificate, DateTime expirationDate)
Parameters
Type | Name | Description |
---|---|---|
TlsCertificate | oldCertificate | The old certificate. |
DateTime | expirationDate | The expiration date. |
Returns
Type | Description |
---|---|
TlsCertificate |
ParseBytes(Byte[])
Deserializes a certificate from binary.
Declaration
public static TlsCertificate ParseBytes(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | The bytes. |
Returns
Type | Description |
---|---|
TlsCertificate |