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