Initializer
init(key:)
ECDSA.PrivateKey with ECDSA parameters.init(key: String) throws
Parameters
parametersThe
ECDSAParameterstuple containing the x and y coordinates of the public key. These coordinates should be base64 URL encoded strings.privateKeyA base64 URL encoded string representation of the private key. If provided, it is used to create the private key for the instance. Defaults to
nil.
Discussion
Throws
JWTError/genericwith the identifierecCoordinatesif the x and y coordinates fromparameterscannot be interpreted as base64 encoded data.JWTError/genericwith the identifierecPrivateKeyif the providedprivateKeyis non-nil but cannot be interpreted as a validPrivateKey.
Note
The ECDSAParameters tuple is assumed to have x and y properties that are base64 URL encoded strings representing the respective coordinates of an ECDSA public key.