Expand description
Wrapper for node/browser webcrypto
Variables
Functions
sourcederiveKey
deriveKey
source<T, U>(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, key: CryptoKey, derivedKeyType: U, extractable: boolean, keyUsages: KeyUsage[]): Promise<T>
<T, U>(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, key: CryptoKey, derivedKeyType: U, extractable: boolean, keyUsages: KeyUsage[]): Promise<T>
Type Parameters
T extends CryptoKey
U extends AlgorithmIdentifier | HkdfParams | Pbkdf2Params | AesDerivedKeyParams | HmacImportParams
Parameters
algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params
key: CryptoKey
derivedKeyType: U
extractable: boolean
keyUsages: KeyUsage[]
Returns Promise<T>
sourceexportKey
exportKey
source<T>(format: "jwk", key: T): Promise<JsonWebKey>
<T>(format: "jwk", key: T): Promise<JsonWebKey>
Type Parameters
T extends CryptoKey
Parameters
format: "jwk"
key: T
Returns Promise<JsonWebKey>
source<T>(format: "pkcs8" | "raw" | "spki", key: T): Promise<ArrayBuffer>
<T>(format: "pkcs8" | "raw" | "spki", key: T): Promise<ArrayBuffer>
Type Parameters
T extends CryptoKey
Parameters
format: "pkcs8" | "raw" | "spki"
key: T
Returns Promise<ArrayBuffer>
sourcegenerateKey
generateKey
source<T, U>(algorithm: U, extractable: boolean, keyUsages: KeyUsage[]): Promise<T>
<T, U>(algorithm: U, extractable: boolean, keyUsages: KeyUsage[]): Promise<T>
Type Parameters
T extends CryptoKey | CryptoKeyPair
U extends AlgorithmIdentifier | Pbkdf2Params | RsaHashedKeyGenParams | EcKeyGenParams | AesKeyGenParams | HmacKeyGenParams
Parameters
algorithm: U
extractable: boolean
keyUsages: KeyUsage[]
Returns Promise<T>
sourceimportKey
importKey
source<T, U>(format: "jwk", key: JsonWebKey, algorithm: U, extractable: boolean, keyUsages: KeyUsage[]): Promise<T>
<T, U>(format: "jwk", key: JsonWebKey, algorithm: U, extractable: boolean, keyUsages: KeyUsage[]): Promise<T>
Type Parameters
T extends CryptoKey
U extends AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm
Parameters
format: "jwk"
key: JsonWebKey
algorithm: U
extractable: boolean
keyUsages: KeyUsage[]
Returns Promise<T>
source<T, U>(format: "pkcs8" | "raw" | "spki", key: BufferSource, algorithm: U, extractable: boolean, keyUsages: KeyUsage[]): Promise<T>
<T, U>(format: "pkcs8" | "raw" | "spki", key: BufferSource, algorithm: U, extractable: boolean, keyUsages: KeyUsage[]): Promise<T>
Type Parameters
T extends CryptoKey
U extends AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm
Parameters
format: "pkcs8" | "raw" | "spki"
key: BufferSource
algorithm: U
extractable: boolean
keyUsages: KeyUsage[]
Returns Promise<T>
sourceunwrapKey
unwrapKey
source<T, U, V>(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: T, unwrapAlgorithm: U, unwrappedKeyAlgorithm: V, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>
<T, U, V>(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: T, unwrapAlgorithm: U, unwrappedKeyAlgorithm: V, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>
Type Parameters
T extends CryptoKey
U extends AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams
V extends AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm
Parameters
format: KeyFormat
wrappedKey: BufferSource
unwrappingKey: T
unwrapAlgorithm: U
unwrappedKeyAlgorithm: V
extractable: boolean
keyUsages: KeyUsage[]
Returns Promise<CryptoKey>
sourcewrapKey
wrapKey
source<T, U>(format: KeyFormat, key: CryptoKey, wrappingKey: T, wrapAlgorithm: U): Promise<ArrayBuffer>
<T, U>(format: KeyFormat, key: CryptoKey, wrappingKey: T, wrapAlgorithm: U): Promise<ArrayBuffer>
Type Parameters
T extends CryptoKey
U extends AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams
Parameters
format: KeyFormat
key: CryptoKey
wrappingKey: T
wrapAlgorithm: U