The public JWK, with alg and kid.
RFC 7638 SHA-256 thumbprint of the public key; also its kid.
StaticcreateBuilds a key from a CryptoKeyPair, generating a new pair if none is given.
Generated keys are non-extractable unless extractable is set, which sessionStorage requires.
Optionalopts: { alg?: string; extractable?: boolean; keyPair?: CryptoKeyPair } = {}The key object a grant request carries by value (RFC 9635 section 7.1): the proof method and the
public JWK. Register exactly this on the AS (iya-sts: the application's gnapKey).
StaticloadSigns bytes with the private key, as RFC 9421 section 3.3.7 does for a JWS algorithm: ECDSA
signatures are the raw r || s concatenation, which is what WebCrypto produces.
The client instance's key (RFC 9635 section 7.1). In GNAP the key IS the client: it is presented by value in the first request, and every request after is signed with it, so each token the AS issues is bound to it. This library proves it with HTTP message signatures (
httpsig, RFC 9421).The private key is generated NON-EXTRACTABLE: script running in the page (including injected script) can ask it to sign while the page is open, but can never read it out, so a stolen access token or continuation token is useless anywhere else.
IndexedDBKeyStorekeeps that non-extractable key across page loads.WebStorageKeyStorekeeps an extractable copy in sessionStorage for this tab, which is what Web Storage can hold.The JWK's
kidis its RFC 7638 thumbprint, and is thekeyidof every signature.