Structure
JWK
A JSON Web Key.
struct JWK
Overview
Read specification (RFC 7517) https://tools.ietf.org/html/rfc7517.
Topics
Structures
struct AlgorithmSupportedalgalgorithmsstruct Curvestruct KeyTypeSupportedktykey types.
Initializers
init(from: any Decoder) throwsCreates a new instance by decoding from the given decoder.init(json: String) throws
Instance Properties
var algorithm: JWK.Algorithm?Thealg(algorithm) parameter identifies the algorithm intended for use with the key. Thealgvalue is a case-sensitive ASCII string.var curve: JWK.Curve?var exponent: String?eExponent.var keyIdentifier: JWKIdentifier?Thekid(key ID) parameter is used to match a specific key. This is used, for instance, to choose among a set of keys within a JWK Set during key rollover.var keyType: JWK.KeyTypeThekty(key type) parameter identifies the cryptographic algorithm family used with the key, such asRSAorECDSA. Thektyvalue is a case-sensitive string.var modulus: String?nModulus.var prime1: String?pFirst prime factor.var prime2: String?qSecond prime factor.var privateExponent: String?dPrivate exponent.var x: String?var y: String?
Type Methods
static func ecdsa(JWK.Algorithm?, identifier: JWKIdentifier?, x: String?, y: String?, curve: ECDSACurve?, privateKey: String?) -> JWKstatic func octetKeyPair(JWK.Algorithm?, identifier: JWKIdentifier?, x: String?, y: String?, curve: EdDSACurve?, privateKey: String?) -> JWKstatic func rsa(JWK.Algorithm?, identifier: JWKIdentifier?, modulus: String?, exponent: String?, privateExponent: String?) -> JWK
Relationships
Conforms To
Swift.DecodableSwift.EncodableSwift.SendableSwift.SendableMetatype