SCM iOS API
Certificate Class Reference

This class describes a certificate object. Inherits from TokenObject. More...

Inheritance diagram for Certificate:
TokenObject

Instance Methods

(NSString *) - getSubject
 
(NSString *) - getNotBefore
 
(NSString *) - getNotAfter
 
(NSString *) - getIssuer
 
(void) - getSerial:
 
(void) - getSecCertificate:
 
- Instance Methods inherited from TokenObject
(NSString *) - getType
 
(NSString *) - getCkLabel
 
(NSString *) - getCkId
 
(Token *) - getParent
 
(NSUInteger) - getPinNumber
 

Detailed Description

This class describes a certificate object. Inherits from TokenObject.

Note that the constructor is not intended to be called by user code. Such objects are constructed internally by the API.

Method Documentation

◆ getIssuer()

- (NSString *) getIssuer

Gets the issuer name of the certificate.

The string is obtained by using the same rules as for the Certificate#getSubject string.

Returns
the issuer name of the certificate.

◆ getNotAfter()

- (NSString *) getNotAfter

Gets the certificate end of validity date.

Returns
end of validity date, given as RFC1123 string.

◆ getNotBefore()

- (NSString *) getNotBefore

Gets the certificate start of validity date.

Returns
start of validity date, given as RFC1123 string.

◆ getSecCertificate:()

- (void) getSecCertificate: (void(^)(SecCertificateRef ref, NSError *error))  completionHandler

Gets a SecCertificateRef Object created from Certificate.

Parameters
completionHandlerthe completion handler block to be called as soon as the SecCertificateRef is created. The completion handler is executed on the main queue, and takes the following parameters :
  • ref the SecCertificateRef object.
  • error nil if the SecCertificate object is created successfully; otherwise an NSError encapsulates the reason of failure.

◆ getSerial:()

- (void) getSerial: (void(^)(NSString *serial, NSError *error))  completionHandler

Gets the certificate serial number.

Parameters
completionHandlerthe completion handler block to be called as soon as the serial number is retrieved. The completion handler is executed on the main queue, and takes the following parameters :
  • serial the serial number of the certificate.
  • error nil if the serial number is retrieved successfully; otherwise an NSError encapsulates the reason of failure.

◆ getSubject()

- (NSString *) getSubject

Gets the subject name of the certificate.

The string is extracted from the last (most specific) occurrence of common name field.

If no such field is defined, the implementation falls back on the first organizational unit name field, or the first organization name field, or the first email address field (in this order).

Returns
the subject name of the certificate.

The documentation for this class was generated from the following files: