FMLiveSwitchDtlsCertificate Class Reference

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

Instance Methods

(FMLiveSwitchDtlsCertificate *) - createCertificate
 Creates the certificate. More...
 
(FMLiveSwitchDtlsFingerprint *) - 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 (ECDSA). More...
 
(FMLiveSwitchDtlsCertificate *) + dtlsCertificate
 
(FMLiveSwitchDtlsCertificate *) + generateCertificate
 Generates a certificate with a default issuer/subject name and an expiration date of 10 days from now. More...
 
(FMLiveSwitchDtlsCertificate *) + generateCertificateFromOldCertificate:
 Generates a certificate using the issuer/subject name from an old certificate and an expiration date of 10 days from now. More...
 
(FMLiveSwitchDtlsCertificate *) + generateCertificateFromOldCertificate:expirationDate:
 Generates a certificate using the issuer/subject name from an old certificate and the given expiration date. More...
 
(FMLiveSwitchDtlsCertificate *) + generateCertificateWithIssuerName:subjectName:
 Generates a certificate with the given issuer name, subject name, and an expiration date of 10 days from now. More...
 
(FMLiveSwitchDtlsCertificate *) + generateCertificateWithIssuerName:subjectName:expirationDate:
 Generates a certificate with the given issuer name, subject name, and expiration date. More...
 
(FMLiveSwitchDtlsCertificate *) + generateCertificateWithIssuerName:subjectName:expirationDate:key:
 Generates a certificate with the given issuer name, subject name, expiration date, and asymmetric key. More...
 
(FMLiveSwitchDtlsCertificate *) + generateCertificateWithIssuerName:subjectName:expirationDate:keyType:
 Generates a certificate with the given issuer name, subject name, expiration date, and asymmetric key. More...
 
(FMLiveSwitchDtlsCertificate *) + generateCertificateWithIssuerName:subjectName:key:
 Generates a certificate with the given issuer name, subject name, and an expiration date of 10 days from now. More...
 
(FMLiveSwitchDtlsCertificate *) + generateCertificateWithIssuerName:subjectName:keyType:
 Generates a certificate with the given issuer name, subject name, and an expiration date of 10 days from now. More...
 
(FMLiveSwitchDtlsCertificate *) + generateCertificateWithKey:
 Generates a certificate with a default issuer/subject name and an expiration date of 10 days from now. More...
 
(FMLiveSwitchDtlsCertificate *) + generateCertificateWithKeyType:
 Generates a certificate with a default issuer/subject name and an expiration date of 10 days from now. More...
 
(FMLiveSwitchDtlsCertificate *) + generateCertificateWithName:
 Generates a certificate with the given issuer/subject name and an expiration date of 10 days from now. More...
 
(FMLiveSwitchDtlsCertificate *) + generateCertificateWithName:key:
 Generates a certificate with the given issuer/subject name and an expiration date of 10 days from now. More...
 
(FMLiveSwitchDtlsCertificate *) + generateCertificateWithName:keyType:
 Generates a certificate with the given issuer/subject name and an expiration date of 10 days from now. More...
 
(FMLiveSwitchDtlsCertificate *) + parseBytes:
 Deserializes a certificate from binary. More...
 
(void) + setDefaultKeyType:
 Sets the default asymmetric key type (ECDSA). More...
 
- 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 DTLS communication.

Method Documentation

◆ createCertificate

- (FMLiveSwitchDtlsCertificate*) createCertificate

Creates the certificate.

Implements FMLiveSwitchCertificate.

◆ createFingerprintWithAlgorithm:value:

- (FMLiveSwitchDtlsFingerprint*) 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 (ECDSA).

◆ dtlsCertificate

+ (FMLiveSwitchDtlsCertificate*) dtlsCertificate

◆ generateCertificate

+ (FMLiveSwitchDtlsCertificate*) generateCertificate

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

◆ generateCertificateFromOldCertificate:

+ (FMLiveSwitchDtlsCertificate*) generateCertificateFromOldCertificate: (FMLiveSwitchDtlsCertificate *)  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:

+ (FMLiveSwitchDtlsCertificate*) generateCertificateFromOldCertificate: (FMLiveSwitchDtlsCertificate *)  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:

+ (FMLiveSwitchDtlsCertificate*) 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:

+ (FMLiveSwitchDtlsCertificate*) 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:

+ (FMLiveSwitchDtlsCertificate*) 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:

+ (FMLiveSwitchDtlsCertificate*) 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:

+ (FMLiveSwitchDtlsCertificate*) 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:

+ (FMLiveSwitchDtlsCertificate*) 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:

+ (FMLiveSwitchDtlsCertificate*) 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:

+ (FMLiveSwitchDtlsCertificate*) 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:

+ (FMLiveSwitchDtlsCertificate*) 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:

+ (FMLiveSwitchDtlsCertificate*) 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:

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

Deserializes a certificate from binary.

Parameters
bytesThe bytes.

◆ setDefaultKeyType:

+ (void) setDefaultKeyType: (FMLiveSwitchAsymmetricKeyType)  value

Sets the default asymmetric key type (ECDSA).