ol.clave.crypto.impl.jws
jws-alg
Return the JWS alg header value for a key.
| Key Type | Result | |----------|-----------| | P-256 | "ES256" | | P-384 | "ES384" | | Ed25519 | "EdDSA" | | RSA | "RS256" |
sign
Sign data bytes, return signature bytes in JWS format.
For ECDSA, returns R||S concatenated (not DER). For EdDSA and RSA, returns raw signature bytes.
protected-header-json
(protected-header-json alg kid nonce url jwk-json)
Construct the protected header JSON string with deterministic field order.
final-jws-json
(final-jws-json protected-b64 payload-b64 signature-b64)
Assemble the final JWS JSON object with deterministic ordering.
protected-dot-payload-bytes
(protected-dot-payload-bytes protected-b64 payload-b64)
Return ASCII bytes of '<protected>.<payload>'.
encode-payload-b64
(encode-payload-b64 payload-json)
Base64url-encode the payload JSON string or return the empty string when nil.
encode-protected-b64
(encode-protected-b64 alg kid nonce url jwk-json)
Construct and base64url-encode the protected header JSON.
encode-signature-b64
(encode-signature-b64 alg private-key-or-mac protected-dot-payload)
Compute the signature for the given alg and return base64url-encoded value.