fm.liveswitch.TlsCertificate Class Reference

A certificate to be used for TLS communication. More...

Public Member Functions

 TlsCertificate ()
 

Static Public Member Functions

static fm.liveswitch.TlsCertificate generateCertificate ()
 Generates a certificate with a default issuer/subject name and an expiration date of 10 days from now. More...
 
static fm.liveswitch.TlsCertificate generateCertificate (String issuerName, String subjectName)
 Generates a certificate with the given issuer name, subject name, and an expiration date of 10 days from now. More...
 
static fm.liveswitch.TlsCertificate generateCertificate (String issuerName, String subjectName, java.util.Date expirationDate)
 Generates a certificate with the given issuer name, subject name, and expiration date. More...
 
static fm.liveswitch.TlsCertificate generateCertificate (String issuerName, String subjectName, java.util.Date expirationDate, fm.liveswitch.AsymmetricKey key)
 Generates a certificate with the given issuer name, subject name, expiration date, and asymmetric key. More...
 
static fm.liveswitch.TlsCertificate generateCertificate (String issuerName, String subjectName, java.util.Date expirationDate, fm.liveswitch.AsymmetricKeyType keyType)
 Generates a certificate with the given issuer name, subject name, expiration date, and asymmetric key. More...
 
static fm.liveswitch.TlsCertificate generateCertificate (String issuerName, String subjectName, fm.liveswitch.AsymmetricKey key)
 Generates a certificate with the given issuer name, subject name, and an expiration date of 10 days from now. More...
 
static fm.liveswitch.TlsCertificate generateCertificate (String issuerName, String subjectName, fm.liveswitch.AsymmetricKeyType keyType)
 Generates a certificate with the given issuer name, subject name, and an expiration date of 10 days from now. More...
 
static fm.liveswitch.TlsCertificate generateCertificate (fm.liveswitch.AsymmetricKey key)
 Generates a certificate with a default issuer/subject name and an expiration date of 10 days from now. More...
 
static fm.liveswitch.TlsCertificate generateCertificate (fm.liveswitch.AsymmetricKeyType keyType)
 Generates a certificate with a default issuer/subject name and an expiration date of 10 days from now. More...
 
static fm.liveswitch.TlsCertificate generateCertificate (String name)
 Generates a certificate with the given issuer/subject name and an expiration date of 10 days from now. More...
 
static fm.liveswitch.TlsCertificate generateCertificate (String name, fm.liveswitch.AsymmetricKey key)
 Generates a certificate with the given issuer/subject name and an expiration date of 10 days from now. More...
 
static fm.liveswitch.TlsCertificate generateCertificate (String name, fm.liveswitch.AsymmetricKeyType keyType)
 Generates a certificate with the given issuer/subject name and an expiration date of 10 days from now. More...
 
static fm.liveswitch.TlsCertificate generateCertificateFromOldCertificate (fm.liveswitch.TlsCertificate oldCertificate)
 Generates a certificate using the issuer/subject name from an old certificate and an expiration date of 10 days from now. More...
 
static fm.liveswitch.TlsCertificate generateCertificateFromOldCertificate (fm.liveswitch.TlsCertificate oldCertificate, java.util.Date expirationDate)
 Generates a certificate using the issuer/subject name from an old certificate and the given expiration date. More...
 
static fm.liveswitch.AsymmetricKeyType getDefaultKeyType ()
 Gets the default asymmetric key type (RSA). More...
 
static fm.liveswitch.TlsCertificate parseBytes (byte[] bytes)
 Deserializes a certificate from binary. More...
 
static void setDefaultKeyType (fm.liveswitch.AsymmetricKeyType value)
 Sets the default asymmetric key type (RSA). More...
 

Protected Member Functions

fm.liveswitch.TlsCertificate createCertificate ()
 Creates the certificate. More...
 
fm.liveswitch.TlsFingerprint createFingerprint (String algorithm, String value)
 Creates a fingerprint. More...
 

Detailed Description

A certificate to be used for TLS communication.

Constructor & Destructor Documentation

◆ TlsCertificate()

fm.liveswitch.TlsCertificate.TlsCertificate ( )

Member Function Documentation

◆ createCertificate()

fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.createCertificate ( )
protected

Creates the certificate.

◆ createFingerprint()

fm.liveswitch.TlsFingerprint fm.liveswitch.TlsCertificate.createFingerprint ( String  algorithm,
String  value 
)
protected

Creates a fingerprint.

Parameters
algorithmThe algorithm.
valueThe value.

◆ generateCertificate() [1/12]

static fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.generateCertificate ( )
static

Generates a certificate with a default issuer/subject name and an expiration date of 10 days from now.

◆ generateCertificate() [2/12]

static fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.generateCertificate ( fm.liveswitch.AsymmetricKey  key)
static

Generates a certificate with a default issuer/subject name and an expiration date of 10 days from now.

Parameters
keyThe asymmetric key (with public and private details).

◆ generateCertificate() [3/12]

static fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.generateCertificate ( fm.liveswitch.AsymmetricKeyType  keyType)
static

Generates a certificate with a default issuer/subject name and an expiration date of 10 days from now.

Parameters
keyTypeThe asymmetric key type.

◆ generateCertificate() [4/12]

static fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.generateCertificate ( String  issuerName,
String  subjectName 
)
static

Generates a certificate with the given issuer name, subject name, and an expiration date of 10 days from now.

Parameters
issuerNameThe name of the issuer.
subjectNameThe name of the subject.

◆ generateCertificate() [5/12]

static fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.generateCertificate ( String  issuerName,
String  subjectName,
fm.liveswitch.AsymmetricKey  key 
)
static

Generates a certificate with the given issuer name, subject name, and an expiration date of 10 days from now.

Parameters
issuerNameThe name of the issuer.
subjectNameThe name of the subject.
keyThe asymmetric key (with public and private details).

◆ generateCertificate() [6/12]

static fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.generateCertificate ( String  issuerName,
String  subjectName,
fm.liveswitch.AsymmetricKeyType  keyType 
)
static

Generates a certificate with the given issuer name, subject name, and an expiration date of 10 days from now.

Parameters
issuerNameThe name of the issuer.
subjectNameThe name of the subject.
keyTypeThe asymmetric key type.

◆ generateCertificate() [7/12]

static fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.generateCertificate ( String  issuerName,
String  subjectName,
java.util.Date  expirationDate 
)
static

Generates a certificate with the given issuer name, subject name, and expiration date.

Parameters
issuerNameThe name of the issuer.
subjectNameThe name of the subject.
expirationDateThe expiration date.

◆ generateCertificate() [8/12]

static fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.generateCertificate ( String  issuerName,
String  subjectName,
java.util.Date  expirationDate,
fm.liveswitch.AsymmetricKey  key 
)
static

Generates a certificate with the given issuer name, subject name, expiration date, and asymmetric key.

Parameters
issuerNameThe name of the issuer.
subjectNameThe name of the subject.
expirationDateThe expiration date.
keyThe asymmetric key (with public and private details).

◆ generateCertificate() [9/12]

static fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.generateCertificate ( String  issuerName,
String  subjectName,
java.util.Date  expirationDate,
fm.liveswitch.AsymmetricKeyType  keyType 
)
static

Generates a certificate with the given issuer name, subject name, expiration date, and asymmetric key.

Parameters
issuerNameThe name of the issuer.
subjectNameThe name of the subject.
expirationDateThe expiration date.
keyTypeThe asymmetric key type.

◆ generateCertificate() [10/12]

static fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.generateCertificate ( String  name)
static

Generates a certificate with the given issuer/subject name and an expiration date of 10 days from now.

Parameters
nameThe name of the issuer/subject.

◆ generateCertificate() [11/12]

static fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.generateCertificate ( String  name,
fm.liveswitch.AsymmetricKey  key 
)
static

Generates a certificate with the given issuer/subject name and an expiration date of 10 days from now.

Parameters
nameThe name of the issuer/subject.
keyThe asymmetric key (with public and private details).

◆ generateCertificate() [12/12]

static fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.generateCertificate ( String  name,
fm.liveswitch.AsymmetricKeyType  keyType 
)
static

Generates a certificate with the given issuer/subject name and an expiration date of 10 days from now.

Parameters
nameThe name of the issuer/subject.
keyTypeThe asymmetric key type.

◆ generateCertificateFromOldCertificate() [1/2]

static fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.generateCertificateFromOldCertificate ( fm.liveswitch.TlsCertificate  oldCertificate)
static

Generates a certificate using the issuer/subject name from an old certificate and an expiration date of 10 days from now.

Parameters
oldCertificateThe old certificate.

◆ generateCertificateFromOldCertificate() [2/2]

static fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.generateCertificateFromOldCertificate ( fm.liveswitch.TlsCertificate  oldCertificate,
java.util.Date  expirationDate 
)
static

Generates a certificate using the issuer/subject name from an old certificate and the given expiration date.

Parameters
oldCertificateThe old certificate.
expirationDateThe expiration date.

◆ getDefaultKeyType()

static fm.liveswitch.AsymmetricKeyType fm.liveswitch.TlsCertificate.getDefaultKeyType ( )
static

Gets the default asymmetric key type (RSA).

◆ parseBytes()

static fm.liveswitch.TlsCertificate fm.liveswitch.TlsCertificate.parseBytes ( byte[]  bytes)
static

Deserializes a certificate from binary.

Parameters
bytesThe bytes.

◆ setDefaultKeyType()

static void fm.liveswitch.TlsCertificate.setDefaultKeyType ( fm.liveswitch.AsymmetricKeyType  value)
static

Sets the default asymmetric key type (RSA).