mirror of
https://github.com/danbulant/jose
synced 2026-05-24 20:41:46 +00:00
docs: update keylike interface description
This commit is contained in:
parent
5487311ca9
commit
1d49c6b78c
1 changed files with 11 additions and 5 deletions
16
src/types.d.ts
vendored
16
src/types.d.ts
vendored
|
|
@ -80,20 +80,26 @@ export interface GetKeyFunction<T, T2> {
|
|||
(protectedHeader: T, token: T2): Promise<KeyLike>
|
||||
}
|
||||
|
||||
/* eslint-disable jsdoc/check-indentation */
|
||||
/**
|
||||
* KeyLike are platform-specific references to keying material.
|
||||
*
|
||||
* - [KeyObject](https://nodejs.org/api/crypto.html#crypto_class_keyobject) instances come from
|
||||
* node's [crypto module](https://nodejs.org/api/crypto.html) (see crypto.generateKeyPair,
|
||||
* crypto.createPublicKey, crypto.createPrivateKey, crypto.createSecretKey).
|
||||
* - [CryptoKey](https://www.w3.org/TR/WebCryptoAPI) instances come from
|
||||
* [Web Cryptography API](https://www.w3.org/TR/WebCryptoAPI) (see SubtleCrypto.importKey,
|
||||
* SubtleCrypto.generateKey, SubtleCrypto.deriveKey, SubtleCrypto.unwrapKey).
|
||||
* node's [crypto module](https://nodejs.org/api/crypto.html), e.g.:
|
||||
* - [crypto.generateKeyPair](https://nodejs.org/api/crypto.html#crypto_crypto_generatekeypair_type_options_callback)
|
||||
* - [crypto.createPublicKey](https://nodejs.org/api/crypto.html#crypto_crypto_createpublickey_key)
|
||||
* - [crypto.createPrivateKey](https://nodejs.org/api/crypto.html#crypto_crypto_createprivatekey_key)
|
||||
* - [crypto.createSecretKey](https://nodejs.org/api/crypto.html#crypto_crypto_createsecretkey_key_encoding)
|
||||
* - [CryptoKey](https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey) instances come from
|
||||
* [Web Cryptography API](https://www.w3.org/TR/WebCryptoAPI), e.g.:
|
||||
* - [SubtleCrypto.importKey](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey)
|
||||
* - [SubtleCrypto.generateKey](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/generateKey)
|
||||
* - [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)
|
||||
* is used exclusively for symmetric secret representations, a CryptoKey or KeyObject is
|
||||
* preferred, but in Web Crypto API this isn't an option for some algorithms.
|
||||
*/
|
||||
export type KeyLike = KeyObject | CryptoKey | Uint8Array
|
||||
/* eslint-enable */
|
||||
|
||||
/**
|
||||
* Flattened JWS definition for verify function inputs, allows payload as
|
||||
|
|
|
|||
Loading…
Reference in a new issue