SCM iOS API
Pin Class Reference

Class represents a PIN that protects smart card contents. More...

Inherits NSObject.

Instance Methods

(NSString *) - getLabel
 
(BOOL) - isInitialized
 
(BOOL) - isToBeChanged
 
(BOOL) - isBlocked
 
(BOOL) - isTryCountLow
 
(BOOL) - isLastTry
 
(BOOL) - isValidated
 
(int) - getRemainingTries
 
(void) - login:completionHandler:
 
(void) - loginSO:completionHandler:
 
(void) - change:newValue:completionHandler:
 
(void) - logout:
 
(void) - getConstraints:
 

Detailed Description

Class represents a PIN that protects smart card contents.

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

Method Documentation

◆ change:newValue:completionHandler:()

- (void) change: (NSString *)  oldValue
newValue: (NSString *)  newValue
completionHandler: (void(^)(NSError *))  completionHandler 

Changes the PIN. The operation can only be made against the user PIN.

Parameters
oldValuethe current PIN value. May be nilif a protected authentication path exists Token#hasProtectedAuthPath.
newValuethe PIN value. May be nilif a protected authentication path exists.
completionHandlerthe completion handler block to be called as soon as the login is complete. The completion handler is executed on the main queue. On output, an error object that indicates why the pin change failed, or nil if the pin change was successful.

◆ getConstraints:()

- (void) getConstraints: (void(^)(NSArray *constraints, NSError *error))  completionHandler

Gets the format constraints of the PIN as an array of PinConstraint object.

Parameters
completionHandlerthe completionHandler is executed on tha main queue once the result is obtained, and takes the following parameters:
  • constraints the PinConstraint array.
  • error nil if the operation is completed successfully; otherwise an NSError encapsulates the reason of failure.

◆ getLabel()

- (NSString *) getLabel

Gets the PIN label. Can be undefined if the card has a single PIN without explicit label defined.

Returns
the PIN label.

◆ getRemainingTries()

- (int) getRemainingTries

Returns the number of remaining tries for the PIN verification. Can be undefined if the information is unavailable.

Returns
the number of remaining tries of the PIN verification.

◆ isBlocked()

- (BOOL) isBlocked

Returns YES if the PIN is blocked.

Returns
YES if the PIN is blocked; NO otherwise.

◆ isInitialized()

- (BOOL) isInitialized

Returns YES if the PIN has been initialized.

Returns
YES if the PIN has been initialized; NO otherwise.

◆ isLastTry()

- (BOOL) isLastTry

Returns YES if the PIN try counter shows only one attempt remaining.

Returns
YES if the PIN try counter shows only one attempt remaining; NO otherwise.

◆ isToBeChanged()

- (BOOL) isToBeChanged

Returns YES if the PIN need to be changed before use.

Returns
YES if the PIN need to be changed before use; NO otherwise.

◆ isTryCountLow()

- (BOOL) isTryCountLow

Returns YES if the PIN try counter is lower than the maximun (an unsuccessful verification attempt has been made).

Returns
YES if the PIN try counter is lower than the maximun; NO otherwise.

◆ isValidated()

- (BOOL) isValidated

Returns YES if the PIN has been successfully verified (access to the private objects is granted).

Returns
YES if the PIN has been successfully verified; NO otherwise.

◆ login:completionHandler:()

- (void) login: (NSString *)  value
completionHandler: (void(^)(NSError *error))  completionHandler 

Verifies the PIN.

Parameters
valuethe PIN value. May be nil if a protected authentication path exists (Token#hasProtectedAuthPath).
completionHandlerthe completion handler block to be called as soon as the login is complete. The completion handler is executed on the main queue. On output, an error object that indicates why the login failed, or nil if the login was successful.

◆ loginSO:completionHandler:()

- (void) loginSO: (NSString *)  value
completionHandler: (void(^)(NSError *error))  completionHandler 

Verifies the security officer (administrator or unblocking) PIN.

Parameters
valuethe PIN value. May be nilif a protected authentication path exists (Token#hasProtectedAuthPath).
completionHandlerthe completion handler block to be called as soon as the login is complete. The completion handler is executed on the main queue. On output, an error object that indicates why the login failed, or nil if the login was successful.

◆ logout:()

- (void) logout: (void(^)(NSError *error))  completionHandler

Resets the verified status of the PIN (cancels a call to Pin#login:completionHandler:).

Parameters
completionHandlerthe completion handler block to be called as soon as the verified status of the PIN is reset. The completion handler is executed on the main queue. On output, an error object that indicates the reason of failure, or nil if the was successful.

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