Skip to content

SubtleCrypto

Values

decrypt

let decrypt: (
WebCryptoTypes.subtleCrypto,
~algorithm: WebCryptoTypes.algorithmIdentifier,
~key: WebCryptoTypes.cryptoKey,
~data: ArrayBufferTypedArrayOrDataView.t,
) => promise<ArrayBuffer.t>

Parameters

WebCryptoTypes.subtleCrypto WebCryptoTypes.algorithmIdentifier WebCryptoTypes.cryptoKey ArrayBufferTypedArrayOrDataView.t

Return type

promise< Stdlib.ArrayBuffer.t >

deriveBits

let deriveBits: (
WebCryptoTypes.subtleCrypto,
~algorithm: WebCryptoTypes.algorithm,
~baseKey: WebCryptoTypes.cryptoKey,
~length: int=?,
) => promise<ArrayBuffer.t>

Parameters

WebCryptoTypes.subtleCrypto WebCryptoTypes.algorithm WebCryptoTypes.cryptoKey option< int >

Return type

promise< Stdlib.ArrayBuffer.t >

deriveBits2

let deriveBits2: (
WebCryptoTypes.subtleCrypto,
~algorithm: string,
~baseKey: WebCryptoTypes.cryptoKey,
~length: int=?,
) => promise<ArrayBuffer.t>

Parameters

WebCryptoTypes.subtleCrypto string WebCryptoTypes.cryptoKey option< int >

Return type

promise< Stdlib.ArrayBuffer.t >

deriveKey

let deriveKey: (
WebCryptoTypes.subtleCrypto,
~algorithm: WebCryptoTypes.algorithmIdentifier,
~baseKey: WebCryptoTypes.cryptoKey,
~derivedKeyType: WebCryptoTypes.algorithmIdentifier,
~extractable: bool,
~keyUsages: array<WebCryptoTypes.keyUsage>,
) => promise<JSON.t>

Parameters

WebCryptoTypes.subtleCrypto WebCryptoTypes.algorithmIdentifier WebCryptoTypes.cryptoKey WebCryptoTypes.algorithmIdentifier bool array< WebCryptoTypes.keyUsage >

Return type

promise< Stdlib.JSON.t >

digest

let digest: (
WebCryptoTypes.subtleCrypto,
~algorithm: WebCryptoTypes.algorithmIdentifier,
~data: ArrayBufferTypedArrayOrDataView.t,
) => promise<JSON.t>

Parameters

WebCryptoTypes.subtleCrypto WebCryptoTypes.algorithmIdentifier ArrayBufferTypedArrayOrDataView.t

Return type

promise< Stdlib.JSON.t >

encrypt

let encrypt: (
WebCryptoTypes.subtleCrypto,
~algorithm: WebCryptoTypes.algorithmIdentifier,
~key: WebCryptoTypes.cryptoKey,
~data: ArrayBufferTypedArrayOrDataView.t,
) => promise<ArrayBuffer.t>

Parameters

WebCryptoTypes.subtleCrypto WebCryptoTypes.algorithmIdentifier WebCryptoTypes.cryptoKey ArrayBufferTypedArrayOrDataView.t

Return type

promise< Stdlib.ArrayBuffer.t >

exportKey

let exportKey: (
WebCryptoTypes.subtleCrypto,
~format: WebCryptoTypes.keyFormat,
~key: WebCryptoTypes.cryptoKey,
) => promise<JSON.t>

Parameters

WebCryptoTypes.subtleCrypto WebCryptoTypes.keyFormat WebCryptoTypes.cryptoKey

Return type

promise< Stdlib.JSON.t >

generateKey

let generateKey: (
WebCryptoTypes.subtleCrypto,
~algorithm: WebCryptoTypes.algorithm,
~extractable: bool,
~keyUsages: array<WebCryptoTypes.keyUsage>,
) => promise<JSON.t>

Parameters

WebCryptoTypes.subtleCrypto WebCryptoTypes.algorithm bool array< WebCryptoTypes.keyUsage >

Return type

promise< Stdlib.JSON.t >

generateKey2

let generateKey2: (
WebCryptoTypes.subtleCrypto,
~algorithm: string,
~extractable: bool,
~keyUsages: array<WebCryptoTypes.keyUsage>,
) => promise<JSON.t>

Parameters

WebCryptoTypes.subtleCrypto string bool array< WebCryptoTypes.keyUsage >

Return type

promise< Stdlib.JSON.t >

importKey

let importKey: (
WebCryptoTypes.subtleCrypto,
~format: unknown,
~keyData: ArrayBufferTypedArrayOrDataView.t,
~algorithm: WebCryptoTypes.algorithmIdentifier,
~extractable: bool,
~keyUsages: array<WebCryptoTypes.keyUsage>,
) => promise<WebCryptoTypes.cryptoKey>

Parameters

WebCryptoTypes.subtleCrypto unknown ArrayBufferTypedArrayOrDataView.t WebCryptoTypes.algorithmIdentifier bool array< WebCryptoTypes.keyUsage >

Return type

promise< WebCryptoTypes.cryptoKey >

sign

let sign: (
WebCryptoTypes.subtleCrypto,
~algorithm: WebCryptoTypes.algorithmIdentifier,
~key: WebCryptoTypes.cryptoKey,
~data: ArrayBufferTypedArrayOrDataView.t,
) => promise<JSON.t>

Parameters

WebCryptoTypes.subtleCrypto WebCryptoTypes.algorithmIdentifier WebCryptoTypes.cryptoKey ArrayBufferTypedArrayOrDataView.t

Return type

promise< Stdlib.JSON.t >

unwrapKey

let unwrapKey: (
WebCryptoTypes.subtleCrypto,
~format: WebCryptoTypes.keyFormat,
~wrappedKey: ArrayBufferTypedArrayOrDataView.t,
~unwrappingKey: WebCryptoTypes.cryptoKey,
~unwrapAlgorithm: WebCryptoTypes.algorithmIdentifier,
~unwrappedKeyAlgorithm: WebCryptoTypes.algorithmIdentifier,
~extractable: bool,
~keyUsages: array<WebCryptoTypes.keyUsage>,
) => promise<WebCryptoTypes.cryptoKey>

Parameters

WebCryptoTypes.subtleCrypto WebCryptoTypes.keyFormat ArrayBufferTypedArrayOrDataView.t WebCryptoTypes.cryptoKey WebCryptoTypes.algorithmIdentifier WebCryptoTypes.algorithmIdentifier bool array< WebCryptoTypes.keyUsage >

Return type

promise< WebCryptoTypes.cryptoKey >

verify

let verify: (
WebCryptoTypes.subtleCrypto,
~algorithm: WebCryptoTypes.algorithmIdentifier,
~key: WebCryptoTypes.cryptoKey,
~signature: ArrayBufferTypedArrayOrDataView.t,
~data: ArrayBufferTypedArrayOrDataView.t,
) => promise<JSON.t>

Parameters

WebCryptoTypes.subtleCrypto WebCryptoTypes.algorithmIdentifier WebCryptoTypes.cryptoKey ArrayBufferTypedArrayOrDataView.t ArrayBufferTypedArrayOrDataView.t

Return type

promise< Stdlib.JSON.t >

wrapKey

let wrapKey: (
WebCryptoTypes.subtleCrypto,
~format: WebCryptoTypes.keyFormat,
~key: WebCryptoTypes.cryptoKey,
~wrappingKey: WebCryptoTypes.cryptoKey,
~wrapAlgorithm: WebCryptoTypes.algorithm,
) => promise<JSON.t>

Parameters

WebCryptoTypes.subtleCrypto WebCryptoTypes.keyFormat WebCryptoTypes.cryptoKey WebCryptoTypes.cryptoKey WebCryptoTypes.algorithm

Return type

promise< Stdlib.JSON.t >

wrapKey2

let wrapKey2: (
WebCryptoTypes.subtleCrypto,
~format: WebCryptoTypes.keyFormat,
~key: WebCryptoTypes.cryptoKey,
~wrappingKey: WebCryptoTypes.cryptoKey,
~wrapAlgorithm: string,
) => promise<JSON.t>

Parameters

WebCryptoTypes.subtleCrypto WebCryptoTypes.keyFormat WebCryptoTypes.cryptoKey WebCryptoTypes.cryptoKey string

Return type

promise< Stdlib.JSON.t >