EccRecoverKey
public class EccRecoverKey
Utilities for recovering supported ECC keys.
-
Default init.
Declaration
Swift
public init() -
Recover a public key from the private key.
Throws
If the public key cannot be recovered, or another error is encountered.Declaration
Swift
public class func recoverPublicKey(privateKey: Data, curve: EllipticCurveType) throws -> DataParameters
privateKeyThe private key.
curveThe curve
K1orR1.Return Value
The public key.
-
Recover a public key from a signature, message.
Throws
If unable to recover the target public key.Declaration
Swift
public class func recoverPublicKey(signatureDer: Data, message: Data, recid: Int, curve: EllipticCurveType = .r1) throws -> DataParameters
signatureDerThe signature in der format.
messageThe message.
recidThe recovery id (0-3).
curveThe curve
K1orR1.Return Value
The public key.
-
Get the recovery id (recid) for a signature, message and target public key.
Throws
If none of the possible recids recover the target public key.Declaration
Swift
public class func recid(signatureDer: Data, message: Data, targetPublicKey: Data, curve: EllipticCurveType = .r1) throws -> IntParameters
signatureDerThe signature in der format.
messageThe message.
targetPublicKeyThe target public key.
curveThe curve
K1orR1.Return Value
The recovery id (0-3).
View on GitHub
EccRecoverKey Class Reference