Scoop API

scoop:scoop.crypto:0.1.0

scoop.crypto.jws

API

  • enum JwsAlgorithm

    The explicitly selected compact JWS algorithm. Header validation requires the token's alg to match this selection.

  • class JwsException

    Reports invalid or unsupported compact-JWS header or encoding structure.

  • enum JwsSigningKey

    Selects symmetric MAC or asymmetric private-key signing without transferring key ownership.

  • enum JwsVerificationKey

    Selects symmetric MAC or asymmetric public-key verification without transferring ownership.

  • struct VerifiedJws

    The protected header, payload bytes, and optional key identifier after cryptographic verification. Payload claims such as expiry or audience are not interpreted.

  • function importJwk

    Imports a supported public JSON Web Key as an owned PublicKey. The caller must close the returned key.

  • function signCompact

    Validates the protected header and produces the three base64url compact-JWS segments. HS256 needs at least 32 key bytes; ES256 uses the JWS fixed-width signature encoding.

  • function verifyCompactOrNone

    Validates compact syntax and the explicitly selected algorithm, then verifies the signature. A signature mismatch returns None; malformed headers or encodings throw JwsException. Application payload claims remain the caller's responsibility.