oidc-caep-client
    Preparing search index...

    Class DPoPKey

    A DPoP key pair (RFC 9449) and the proofs made with it.

    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 or refresh token is useless anywhere else. Keep the same key for the lifetime of the tokens it binds. IndexedDBKeyStore keeps that non-extractable key across page loads. WebStorageKeyStore keeps an extractable copy in sessionStorage for this tab, which is what Web Storage can hold.

    Index
    • Use DPoPKey.create() or DPoPKey.loadOrCreate() rather than this.

      Parameters

      • alg: string
      • privateKey: CryptoKey
      • publicJwk: Record<string, string>
      • thumbprint: string

      Returns DPoPKey

    alg: string
    publicJwk: Record<string, any>
    thumbprint: string

    RFC 7638 SHA-256 thumbprint of the public key (the jkt).

    • Builds 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.

      Parameters

      • Optionalopts: { alg?: string; extractable?: boolean; keyPair?: CryptoKeyPair } = {}

      Returns Promise<DPoPKey>

    • Loads the key held in store, or creates one and stores it.

      Parameters

      • store: {
            get(): Promise<{ alg: string; keyPair: CryptoKeyPair } | undefined>;
            set(value: any): Promise<void>;
        }
      • Optionalopts: { alg?: string } = {}

      Returns Promise<DPoPKey>

    • Creates a DPoP proof JWT (RFC 9449 §4.2).

      Parameters

      • opts: { accessToken?: string; method: string; nonce?: string; url: string }

      Returns Promise<any>