Protocol
KeysProcessor
public protocol KeysProcessor
Manages elliptic-curve asymmetric keypairs and signes digests
Requirements
getPublicKey(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
Name | Type | Description |
---|---|---|
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(toConfirm:toDecline: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
Name | Type | Description |
---|---|---|
toConfirm | [PCTransaction] |
Transactions to confirm |
toDecline | [PCTransaction] |
Transactions to decline |
user | PCUser |
The user to process operation |
completion | @escaping (Result<PCProcessingRequest, Error>) -> Void |
A closure to be invoked after processing |
result | The |
renew(user:newUniqueID: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
Name | Type | Description |
---|---|---|
user | PCUser |
The user to be renewed |
newUniqueID | String |
The new id for keys and password |
challenge | RenewKeyChallenge |
An additional data to renew operation |
completion | @escaping (Result<PCRenewRequest, Error>) -> Void |
A closure to be invoked after renewing |
result | The |