PACE
public struct PACE
Use-case PACE #14.7.2.1 and #14.7.2.4
-
Start PACE General authenticate - step 1a #14.7.2.1.1
Declaration
Swift
public static func step1a() -> HealthCardCommand
Return Value
Step 1a command
-
Send publicKey data (from response step 1b) command - step 2a #14.7.2.1.2
Declaration
Swift
public static func step2a(publicKey: Data) throws -> HealthCardCommand
Parameters
publicKey
the COSb PCD PK1 to verify on COSa
Return Value
Step 2a command
-
Key agreement - step 3a #14.7.2.1.3
Declaration
Swift
public static func step3a(publicKey: Data) throws -> HealthCardCommand
Parameters
publicKey
the COSb PCD PK2 to verify on COSa
Return Value
Step 3a command
-
Verify/Exchange token - step4a #14.7.2.1.4
Declaration
Swift
public static func step4a(token: Data) throws -> HealthCardCommand
Parameters
token
Exchange token. Must be 8 bytes long
Return Value
Step 4a command
-
Start PACE General authenticate - step 1b #14.7.2.4.1
Declaration
Swift
public static func step1b() -> HealthCardCommand
Return Value
Step 1a command - since they initialize the same way
-
Set the nonce for PACE General authenticate with CAN - step 2b #14.7.2.4.2
Declaration
Swift
public static func step2b(z: Data, can: CAN) throws -> HealthCardCommand
Parameters
z
a nonce of random bytes. Must be 16 bytes long
can
the card’s CAN
Return Value
Step 2b command
-
Key agreement - step 3b #14.7.2.4.3
Declaration
Swift
public static func step3b(publicKey: Data) throws -> HealthCardCommand
Parameters
publicKey
the COSb PCD PK1 to verify on COSb
Return Value
Step 3b command
-
Derive Sessions key - step4b #14.7.2.4.4
Declaration
Swift
public static func step4b(publicKey: Data) throws -> HealthCardCommand
Parameters
publicKey
The data from returned from 3a to derive a session key
Return Value
Step 4b command
-
Verify/Exchange token - step5b #14.7.2.4.5
Declaration
Swift
public static func step5b(token: Data) throws -> HealthCardCommand
Parameters
token
Exchange token. Must be 8 bytes long
Return Value
Step 5b command