PCSDKModule Documentation

Protocol Keys​Processor

public protocol KeysProcessor  

Manages elliptic-curve asymmetric keypairs and signes digests

Requirements

get​Public​Key(user:​completion:​)

func getPublicKey(
        user: PCUser,
        completion: @escaping (_ result: Result<String, Error>) -> Void
    ) 

Returns a public key for provided user in a hexadecimal format

Parameters

user PCUser

The user public key should be returned for

completion @escaping (_ result:​ Result<String, Error>) -> Void

A closure to be invoked

result

Public key for provided user or error

process(to​Confirm:​to​Decline:​user:​completion:​)

func process(
        toConfirm: [PCTransaction],
        toDecline: [PCTransaction],
        user: PCUser,
        completion: @escaping (Result<PCProcessingRequest, Error>) -> Void
    ) 

Processes provided transactions

The completion should return PCProcessingRequest object.

Parameters

to​Confirm [PCTransaction]

Transactions to confirm

to​Decline [PCTransaction]

Transactions to decline

user PCUser

The user to process operation

completion @escaping (Result<PCProcessing​Request, Error>) -> Void

A closure to be invoked after processing

result

The PCProcessingResult object

renew(user:​new​Unique​ID:​challenge:​completion:​)

func renew(
        user: PCUser,
        newUniqueID: String,
        challenge: RenewKeyChallenge,
        completion: @escaping (Result<PCRenewRequest, Error>) -> Void
    ) 

Renews user keys and passwords

The completion should return PCRenewRequest object.

Parameters

user PCUser

The user to be renewed

new​Unique​ID String

The new id for keys and password

challenge Renew​Key​Challenge

An additional data to renew operation

completion @escaping (Result<PCRenew​Request, Error>) -> Void

A closure to be invoked after renewing

result

The PCRenewRequest object