ACS Audio Jack iOS Library  1.0.0
ACRDukptReceiver Class Reference

The ACRDukptReceiver class generates the future keys according to ANSI X9.24-1:2009. More...

#import <ACRDukptReceiver.h>

Inheritance diagram for ACRDukptReceiver:

Instance Methods

(NSData *) - keySerialNumber
 Gets the key serial number. More...
 
(void) - setKeySerialNumber:
 Sets the key serial number. More...
 
(void) - setKeySerialNumber:length:
 Sets the key serial number. More...
 
(NSUInteger) - encryptionCounter
 Gets the encryption counter. More...
 
(void) - loadInitialKey:
 Loads the initial key. More...
 
(void) - loadInitialKey:length:
 Loads the initial key. More...
 
(NSData *) - key
 Gets the key. More...
 

Class Methods

(NSData *) + pinEncryptionKeyFromKey:
 Generates the PIN encryption key from the key. More...
 
(NSData *) + pinEncryptionKeyFromKey:length:
 Generates the PIN encryption key from the key. More...
 
(NSData *) + macRequestKeyFromKey:
 Generates the MAC request key from the key. More...
 
(NSData *) + macRequestKeyFromKey:length:
 Generates the MAC request key from the key. More...
 
(NSData *) + macResponseKeyFromKey:
 Generates the MAC response key from the key. More...
 
(NSData *) + macResponseKeyFromKey:length:
 Generates the MAC response key from the key. More...
 
(NSData *) + dataEncryptionRequestKeyFromKey:
 Generates the data encryption request key from the key. More...
 
(NSData *) + dataEncryptionRequestKeyFromKey:length:
 Generates the data encryption request key from the key. More...
 
(NSData *) + dataEncryptionResponseKeyFromKey:
 Generates the data encryption response key from the key. More...
 
(NSData *) + dataEncryptionResponseKeyFromKey:length:
 Generates the data encryption response key from the key. More...
 
(NSData *) + macFromData:key:
 Generates the MAC from the data. More...
 
(NSData *) + macFromData:dataLength:key:keyLength:
 Generates the MAC from the data. More...
 
(BOOL) + compareKeySerialNumber:ksn2:
 Compares the tow key serial numbers. More...
 
(BOOL) + compareKeySerialNumber:ksn1Length:ksn2:ksn2Length:
 Compares the tow key serial numbers. More...
 
(NSUInteger) + encryptionCounterFromKeySerialNumber:
 Gets the encryption counter from the key serial number. More...
 
(NSUInteger) + encryptionCounterFromKeySerialNumber:length:
 Gets the encryption counter from the key serial number. More...
 

Detailed Description

The ACRDukptReceiver class generates the future keys according to ANSI X9.24-1:2009.

Author
Godfrey Chung
Version
1.0, 25 Mar 2014

Method Documentation

◆ compareKeySerialNumber:ksn1Length:ksn2:ksn2Length:()

+ (BOOL) compareKeySerialNumber: (const uint8_t *)  ksn1
ksn1Length: (NSUInteger)  ksn1Length
ksn2: (const uint8_t *)  ksn2
ksn2Length: (NSUInteger)  ksn2Length 

Compares the tow key serial numbers.

Parameters
ksn1the first key serial number.
ksn1Lengththe first key serial number length.
ksn2the second key serial number.
ksn2Lengththe second key serial number length.
Returns
YES if the two key serial numbers are equal, otherwise NO.

◆ compareKeySerialNumber:ksn2:()

+ (BOOL) compareKeySerialNumber: (NSData *)  ksn1
ksn2: (NSData *)  ksn2 

Compares the tow key serial numbers.

Parameters
ksn1the first key serial number.
ksn2the second key serial number.
Returns
YES if the two key serial numbers are equal, otherwise NO.

◆ dataEncryptionRequestKeyFromKey:()

+ (NSData *) dataEncryptionRequestKeyFromKey: (NSData *)  key

Generates the data encryption request key from the key.

Parameters
keythe key. The length must be 16 bytes.
Returns
the data encryption request key.

◆ dataEncryptionRequestKeyFromKey:length:()

+ (NSData *) dataEncryptionRequestKeyFromKey: (const uint8_t *)  key
length: (NSUInteger)  length 

Generates the data encryption request key from the key.

Parameters
keythe key. The length must be 16 bytes.
lengththe key length.
Returns
the data encryption request key.

◆ dataEncryptionResponseKeyFromKey:()

+ (NSData *) dataEncryptionResponseKeyFromKey: (NSData *)  key

Generates the data encryption response key from the key.

Parameters
keythe key. The length must be 16 bytes.
Returns
the data encryption response key.

◆ dataEncryptionResponseKeyFromKey:length:()

+ (NSData *) dataEncryptionResponseKeyFromKey: (const uint8_t *)  key
length: (NSUInteger)  length 

Generates the data encryption response key from the key.

Parameters
keythe key. The length must be 16 bytes.
lengththe key length.
Returns
the data encryption response key.

◆ encryptionCounter()

- (NSUInteger) encryptionCounter

Gets the encryption counter.

Returns
the encryption counter.

◆ encryptionCounterFromKeySerialNumber:()

+ (NSUInteger) encryptionCounterFromKeySerialNumber: (NSData *)  ksn

Gets the encryption counter from the key serial number.

Parameters
ksnthe key serial number. The length must be 10 bytes.
Returns
the encryption counter.

◆ encryptionCounterFromKeySerialNumber:length:()

+ (NSUInteger) encryptionCounterFromKeySerialNumber: (const uint8_t *)  ksn
length: (NSUInteger)  length 

Gets the encryption counter from the key serial number.

Parameters
ksnthe key serial number. The length must be 10 bytes.
lengththe key serial number length.
Returns
the encryption counter.

◆ key()

- (NSData *) key

Gets the key.

Returns
the key. nil if the maximum encryption count had been reached.

◆ keySerialNumber()

- (NSData *) keySerialNumber

Gets the key serial number.

Returns
the key serial number.

◆ loadInitialKey:()

- (void) loadInitialKey: (NSData *)  initialKey

Loads the initial key.

Parameters
initialKeythe initial key. The length must be 16 bytes.

◆ loadInitialKey:length:()

- (void) loadInitialKey: (const uint8_t *)  initialKey
length: (NSUInteger)  length 

Loads the initial key.

Parameters
initialKeythe initial key. The length must be 16 bytes.
lengththe initial key length.

◆ macFromData:dataLength:key:keyLength:()

+ (NSData *) macFromData: (const uint8_t *)  data
dataLength: (NSUInteger)  dataLength
key: (const uint8_t *)  key
keyLength: (NSUInteger)  keyLength 

Generates the MAC from the data.

Parameters
datathe data.
dataLengththe data length.
keythe key. The length must be 16 bytes.
keyLengththe key length.
Returns
the MAC.

◆ macFromData:key:()

+ (NSData *) macFromData: (NSData *)  data
key: (NSData *)  key 

Generates the MAC from the data.

Parameters
datathe data.
keythe key. The length must be 16 bytes.
Returns
the MAC.

◆ macRequestKeyFromKey:()

+ (NSData *) macRequestKeyFromKey: (NSData *)  key

Generates the MAC request key from the key.

Parameters
keythe key. The length must be 16 bytes.
Returns
the MAC request key.

◆ macRequestKeyFromKey:length:()

+ (NSData *) macRequestKeyFromKey: (const uint8_t *)  key
length: (NSUInteger)  length 

Generates the MAC request key from the key.

Parameters
keythe key. The length must be 16 bytes.
lengththe key length.
Returns
the MAC request key.

◆ macResponseKeyFromKey:()

+ (NSData *) macResponseKeyFromKey: (NSData *)  key

Generates the MAC response key from the key.

Parameters
keythe key. The length must be 16 bytes.
Returns
the MAC response key.

◆ macResponseKeyFromKey:length:()

+ (NSData *) macResponseKeyFromKey: (const uint8_t *)  key
length: (NSUInteger)  length 

Generates the MAC response key from the key.

Parameters
keythe key. The length must be 16 bytes.
lengththe key length.
Returns
the MAC response key.

◆ pinEncryptionKeyFromKey:()

+ (NSData *) pinEncryptionKeyFromKey: (NSData *)  key

Generates the PIN encryption key from the key.

Parameters
keythe key. The length must be 16 bytes.
Returns
the PIN encryption key.

◆ pinEncryptionKeyFromKey:length:()

+ (NSData *) pinEncryptionKeyFromKey: (const uint8_t *)  key
length: (NSUInteger)  length 

Generates the PIN encryption key from the key.

Parameters
keythe key. The length must be 16 bytes.
lengththe key length.
Returns
the PIN encryption key.

◆ setKeySerialNumber:()

- (void) setKeySerialNumber: (NSData *)  keySerialNumber

Sets the key serial number.

Parameters
keySerialNumberthe key serial number.

◆ setKeySerialNumber:length:()

- (void) setKeySerialNumber: (const uint8_t *)  keySerialNumber
length: (NSUInteger)  length 

Sets the key serial number.

Parameters
keySerialNumberthe key serial number.
lengththe key serial number length.

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