class SubtleCrypto
package js.html
The SubtleCrypto
interface represents a set of cryptographic primitives. It is available via the Crypto.subtle
properties available in a window context (via Window.crypto
).
Documentation SubtleCrypto by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See also:
Methods
decrypt(algorithm:EitherType<Dynamic, String>, key:CryptoKey, data:EitherType<ArrayBufferView, ArrayBuffer>):Promise<Dynamic>
Returns a Promise
of the clear data corresponding to the encrypted text, algorithm and key given as parameters.
Throws:
null | DOMError |
---|
deriveBits(algorithm:Dynamic, baseKey:CryptoKey, length:Int):Promise<Dynamic>
deriveBits(algorithm:String, baseKey:CryptoKey, length:Int):Promise<Dynamic>
Returns a Promise
of a newly generated buffer of pseudo-random bits derived from a master key and a specific algorithm given as parameters.
Throws:
null | DOMError |
---|
deriveKey(algorithm:EitherType<Dynamic, String>, baseKey:CryptoKey, derivedKeyType:EitherType<Dynamic, String>, extractable:Bool, keyUsages:Array<String>):Promise<Dynamic>
digest(algorithm:EitherType<Dynamic, String>, data:EitherType<ArrayBufferView, ArrayBuffer>):Promise<Dynamic>
Returns a Promise
of a digest generated from the algorithm and text given as parameters.
Throws:
null | DOMError |
---|
encrypt(algorithm:EitherType<Dynamic, String>, key:CryptoKey, data:EitherType<ArrayBufferView, ArrayBuffer>):Promise<Dynamic>
Returns a Promise
of the encrypted data corresponding to the clear text, algorithm and key given as parameters.
Throws:
null | DOMError |
---|
generateKey(algorithm:Dynamic, extractable:Bool, keyUsages:Array<String>):Promise<Dynamic>
generateKey(algorithm:String, extractable:Bool, keyUsages:Array<String>):Promise<Dynamic>
importKey(format:String, keyData:Dynamic, algorithm:Dynamic, extractable:Bool, keyUsages:Array<String>):Promise<Dynamic>
importKey(format:String, keyData:Dynamic, algorithm:String, extractable:Bool, keyUsages:Array<String>):Promise<Dynamic>
sign(algorithm:EitherType<Dynamic, String>, key:CryptoKey, data:EitherType<ArrayBufferView, ArrayBuffer>):Promise<Dynamic>
Returns a Promise
of the signature corresponding to the text, algorithm and key given as parameters.
Throws:
null | DOMError |
---|
unwrapKey(format:String, wrappedKey:EitherType<ArrayBufferView, ArrayBuffer>, unwrappingKey:CryptoKey, unwrapAlgorithm:EitherType<Dynamic, String>, unwrappedKeyAlgorithm:EitherType<Dynamic, String>, extractable:Bool, keyUsages:Array<String>):Promise<Dynamic>
verify(algorithm:EitherType<Dynamic, String>, key:CryptoKey, signature:EitherType<ArrayBufferView, ArrayBuffer>, data:EitherType<ArrayBufferView, ArrayBuffer>):Promise<Dynamic>
Returns a Promise
of a Boolean
value indicating if the signature given as parameter matches the text, algorithm and key also given as parameters.
Throws:
null | DOMError |
---|
wrapKey(format:String, key:CryptoKey, wrappingKey:CryptoKey, wrapAlgorithm:Dynamic):Promise<Dynamic>
wrapKey(format:String, key:CryptoKey, wrappingKey:CryptoKey, wrapAlgorithm:String):Promise<Dynamic>
Returns a Promise
of a wrapped symmetric key for usage (transfer, storage) in insecure environments. The wrapped buffer returned is in the format given in parameters, and contains the key wrapped by the given wrapping key with the given algorithm.
Throws:
null | DOMError |
---|