FMLiveSwitchTlsCertificate Class Reference

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

Instance Methods

(FMLiveSwitchTlsCertificate *) - createCertificate
 Creates the certificate. More...
 
(FMLiveSwitchTlsFingerprint *) - createFingerprintWithAlgorithm:value:
 Creates a fingerprint. More...
 
(instancetype) - init
 Initializes a new instance of the FMLiveSwitchCertificate`2 class. More...
 
- Instance Methods inherited from FMLiveSwitchCertificate
(TFingerprint) - calculateFingerprintWithAlgorithm:
 Calculates a fingerprint for this certificate. More...
 
(TCertificate) - clone
 Clones this instance. More...
 
(NSDate *) - effectiveDate
 Gets the effective date. More...
 
(NSDate *) - expirationDate
 Gets the expiration date. More...
 
(FMLiveSwitchDataBuffer *) - getBuffer
 Serializes this certificate to binary. More...
 
(NSMutableData *) - getBytes
 Serializes this certificate to binary. More...
 
(NSString *) - id
 Gets the identifier. More...
 
(bool) - isExpired
 Gets whether the certificate is expired. More...
 
(bool) - isExpiring
 Gets whether the certificate is expiring within 24 hours. More...
 
(bool) - isSealed
 Gets a value indicating whether this certificate is sealed and can no longer be modified. More...
 
(NSString *) - issuerName
 Gets the name of the issuer. More...
 
(FMLiveSwitchAsymmetricKey *) - key
 Gets the asymmetric key. More...
 
(void) - regenerate
 Regenerates the certificate's cryptography data using an expiration date of 10 days from now. More...
 
(void) - regenerateWithExpirationDate:
 Regenerates the certificate's cryptography data using the given expiration date. More...
 
(void) - setAutoRegenerate:
 Sets whether the certificate's cryptography data should be automatically regenerated when it is about to expire. More...
 
(void) - setId:
 Sets the identifier. More...
 
(void) - setKey:
 Sets the asymmetric key. More...
 
(NSString *) - subjectName
 Gets the name of the subject. More...
 

Class Methods

(FMLiveSwitchAsymmetricKeyType) + defaultKeyType
 Gets the default asymmetric key type (RSA). More...
 
(FMLiveSwitchTlsCertificate *) + generateCertificate
 Generates a certificate with a default issuer/subject name and an expiration date of 10 days from now. More...
 
(FMLiveSwitchTlsCertificate *) + generateCertificateFromOldCertificate:
 Generates a certificate using the issuer/subject name from an old certificate and an expiration date of 10 days from now. More...
 
(FMLiveSwitchTlsCertificate *) + generateCertificateFromOldCertificate:expirationDate:
 Generates a certificate using the issuer/subject name from an old certificate and the given expiration date. More...
 
(FMLiveSwitchTlsCertificate *) + generateCertificateWithIssuerName:subjectName:
 Generates a certificate with the given issuer name, subject name, and an expiration date of 10 days from now. More...
 
(FMLiveSwitchTlsCertificate *) + generateCertificateWithIssuerName:subjectName:expirationDate:
 Generates a certificate with the given issuer name, subject name, and expiration date. More...
 
(FMLiveSwitchTlsCertificate *) + generateCertificateWithIssuerName:subjectName:expirationDate:key:
 Generates a certificate with the given issuer name, subject name, expiration date, and asymmetric key. More...
 
(FMLiveSwitchTlsCertificate *) + generateCertificateWithIssuerName:subjectName:expirationDate:keyType:
 Generates a certificate with the given issuer name, subject name, expiration date, and asymmetric key. More...
 
(FMLiveSwitchTlsCertificate *) + generateCertificateWithIssuerName:subjectName:key:
 Generates a certificate with the given issuer name, subject name, and an expiration date of 10 days from now. More...
 
(FMLiveSwitchTlsCertificate *) + generateCertificateWithIssuerName:subjectName:keyType:
 Generates a certificate with the given issuer name, subject name, and an expiration date of 10 days from now. More...
 
(FMLiveSwitchTlsCertificate *) + generateCertificateWithKey:
 Generates a certificate with a default issuer/subject name and an expiration date of 10 days from now. More...
 
(FMLiveSwitchTlsCertificate *) + generateCertificateWithKeyType:
 Generates a certificate with a default issuer/subject name and an expiration date of 10 days from now. More...
 
(FMLiveSwitchTlsCertificate *) + generateCertificateWithName:
 Generates a certificate with the given issuer/subject name and an expiration date of 10 days from now. More...
 
(FMLiveSwitchTlsCertificate *) + generateCertificateWithName:key:
 Generates a certificate with the given issuer/subject name and an expiration date of 10 days from now. More...
 
(FMLiveSwitchTlsCertificate *) + generateCertificateWithName:keyType:
 Generates a certificate with the given issuer/subject name and an expiration date of 10 days from now. More...
 
(FMLiveSwitchTlsCertificate *) + parseBytes:
 Deserializes a certificate from binary. More...
 
(void) + setDefaultKeyType:
 Sets the default asymmetric key type (RSA). More...
 
(FMLiveSwitchTlsCertificate *) + tlsCertificate
 
- Class Methods inherited from FMLiveSwitchCertificate
(FMLiveSwitchCertificate *) + certificate
 Initializes a new instance of the FMLiveSwitchCertificate`2 class. More...
 

Additional Inherited Members

- Protected Attributes inherited from FMLiveSwitchCertificate
 __pad0__: NSObject- (bool) autoRegenerate
 

Detailed Description

A certificate to be used for TLS communication.

Method Documentation

◆ createCertificate

- (FMLiveSwitchTlsCertificate*) createCertificate

Creates the certificate.

Implements FMLiveSwitchCertificate.

◆ createFingerprintWithAlgorithm:value:

- (FMLiveSwitchTlsFingerprint*) createFingerprintWithAlgorithm: (NSString *)  algorithm
value: (NSString *)  value 

Creates a fingerprint.

Parameters
algorithmThe algorithm.
valueThe value.

Implements FMLiveSwitchCertificate.

◆ defaultKeyType

+ (FMLiveSwitchAsymmetricKeyType) defaultKeyType

Gets the default asymmetric key type (RSA).

◆ generateCertificate

+ (FMLiveSwitchTlsCertificate*) generateCertificate

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

◆ generateCertificateFromOldCertificate:

+ (FMLiveSwitchTlsCertificate*) generateCertificateFromOldCertificate: (FMLiveSwitchTlsCertificate *)  oldCertificate

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:expirationDate:

+ (FMLiveSwitchTlsCertificate*) generateCertificateFromOldCertificate: (FMLiveSwitchTlsCertificate *)  oldCertificate
expirationDate: (NSDate *)  expirationDate 

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

Parameters
oldCertificateThe old certificate.
expirationDateThe expiration date.

◆ generateCertificateWithIssuerName:subjectName:

+ (FMLiveSwitchTlsCertificate*) generateCertificateWithIssuerName: (NSString *)  issuerName
subjectName: (NSString *)  subjectName 

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.

◆ generateCertificateWithIssuerName:subjectName:expirationDate:

+ (FMLiveSwitchTlsCertificate*) generateCertificateWithIssuerName: (NSString *)  issuerName
subjectName: (NSString *)  subjectName
expirationDate: (NSDate *)  expirationDate 

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.

◆ generateCertificateWithIssuerName:subjectName:expirationDate:key:

+ (FMLiveSwitchTlsCertificate*) generateCertificateWithIssuerName: (NSString *)  issuerName
subjectName: (NSString *)  subjectName
expirationDate: (NSDate *)  expirationDate
key: (FMLiveSwitchAsymmetricKey *)  key 

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).

◆ generateCertificateWithIssuerName:subjectName:expirationDate:keyType:

+ (FMLiveSwitchTlsCertificate*) generateCertificateWithIssuerName: (NSString *)  issuerName
subjectName: (NSString *)  subjectName
expirationDate: (NSDate *)  expirationDate
keyType: (FMLiveSwitchAsymmetricKeyType)  keyType 

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.

◆ generateCertificateWithIssuerName:subjectName:key:

+ (FMLiveSwitchTlsCertificate*) generateCertificateWithIssuerName: (NSString *)  issuerName
subjectName: (NSString *)  subjectName
key: (FMLiveSwitchAsymmetricKey *)  key 

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).

◆ generateCertificateWithIssuerName:subjectName:keyType:

+ (FMLiveSwitchTlsCertificate*) generateCertificateWithIssuerName: (NSString *)  issuerName
subjectName: (NSString *)  subjectName
keyType: (FMLiveSwitchAsymmetricKeyType)  keyType 

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.

◆ generateCertificateWithKey:

+ (FMLiveSwitchTlsCertificate*) generateCertificateWithKey: (FMLiveSwitchAsymmetricKey *)  key

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).

◆ generateCertificateWithKeyType:

+ (FMLiveSwitchTlsCertificate*) generateCertificateWithKeyType: (FMLiveSwitchAsymmetricKeyType)  keyType

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

Parameters
keyTypeThe asymmetric key type.

◆ generateCertificateWithName:

+ (FMLiveSwitchTlsCertificate*) generateCertificateWithName: (NSString *)  name

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.

◆ generateCertificateWithName:key:

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).

◆ generateCertificateWithName:keyType:

+ (FMLiveSwitchTlsCertificate*) generateCertificateWithName: (NSString *)  name
keyType: (FMLiveSwitchAsymmetricKeyType)  keyType 

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.

◆ init

- (instancetype) init

Initializes a new instance of the FMLiveSwitchCertificate`2 class.

Implements FMLiveSwitchCertificate.

◆ parseBytes:

+ (FMLiveSwitchTlsCertificate*) parseBytes: (NSMutableData *)  bytes

Deserializes a certificate from binary.

Parameters
bytesThe bytes.

◆ setDefaultKeyType:

+ (void) setDefaultKeyType: (FMLiveSwitchAsymmetricKeyType)  value

Sets the default asymmetric key type (RSA).

◆ tlsCertificate

+ (FMLiveSwitchTlsCertificate*) tlsCertificate