Instance Method
add(eddsa:kid:parser:serializer:)
Adds an EdDSA key to the collection using an
EdDSAKey.@discardableResult func add(eddsa key: some EdDSAKey, kid: JWKIdentifier? = nil, parser: some JWTParser = DefaultJWTParser(), serializer: some JWTSerializer = DefaultJWTSerializer()) -> Self
Parameters
keyThe
EdDSAKeyused for EdDSA signing. EdDSA keys are known for their short signature and key sizes, which contribute to their efficiency and speed.kidAn optional
JWKIdentifier(Key ID). Providing this identifier allows the JWTkidheader field to reference this specific signer.
Return Value
The same instance of the collection (Self), useful for chaining multiple configuration calls.
Discussion
This method incorporates an EdDSA (Edwards-curve Digital Signature Algorithm) signer into the collection.
Usage Example:
let collection = await JWTKeyCollection()
.addEdDSA(key: myEdDSAKey)