Instance Method
add(ecdsa:kid:parser:serializer:)
Adds an ECDSA key to the collection.
@discardableResult func add(ecdsa key: some ECDSAKey, kid: JWKIdentifier? = nil, parser: some JWTParser = DefaultJWTParser(), serializer: some JWTSerializer = DefaultJWTSerializer()) -> Self
Parameters
keyThe
ECDSAKeyto be used for signing. This key should be securely stored and not exposed.kidAn optional
JWKIdentifier(Key ID). If provided, this identifier will be used in the JWTkidheader field to identify the key.
Return Value
The same instance of the collection (Self), which allows for method chaining.
Discussion
Example Usage:
let collection = await JWTKeyCollection()
.addECDSA(key: myECDSAKey)