SubtleCrypto

@native @JSType trait SubtleCrypto extends Object

w3c ¶14 Subtle Crytpo interface

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).

MDN

class Object
trait Any
class Object
trait Matchable
class Any

Value members

Concrete methods

def decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): Promise[Any]

Returns a Promise of the clear data corresponding to the encrypted text, algorithm and key given as parameters. MDN

Returns a Promise of the clear data corresponding to the encrypted text, algorithm and key given as parameters. MDN

Defined at ¶14.3.2 The decrypt method

def deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length: Double): Promise[Any]

Returns a Promise of a newly generated buffer of pseudo-random bits derivated from a master key and a specific algorithm given as parameters. MDN

Returns a Promise of a newly generated buffer of pseudo-random bits derivated from a master key and a specific algorithm given as parameters. MDN

Defined at ¶14.3.8 The deriveBits method

def deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, derivedKeyType: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: Array[KeyUsage]): Promise[Any]

Returns a Promise of a newly generated CryptoKey derivated from a master key and a specific algorithm given as parameters. MDF

Returns a Promise of a newly generated CryptoKey derivated from a master key and a specific algorithm given as parameters. MDF

Defined at ¶14.3.7 The deriveKey method

We are being a bit more precise than the official definition by requiring KeyAlgorithmIdentifier for derivedKeyType

def digest(algorithm: HashAlgorithmIdentifier, data: BufferSource): Promise[Any]

Returns a Promise of a digest generated from the algorithm and text given as parameters. MDN

Returns a Promise of a digest generated from the algorithm and text given as parameters. MDN

Defined at ¶14.3.5 The digest method We are a bit more precise than the official definition by requiring a HashAlgorithmIdentifier rather than an AlgorithmIdentifier for the algorithm parameter.

def encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): Promise[Any]

Returns a Promise of the encrypted data corresponding to the clear text, algorithm and key given as parameters. MDN

Returns a Promise of the encrypted data corresponding to the clear text, algorithm and key given as parameters. MDN

Defined at ¶14.3.1 The encrypt method

def exportKey(format: KeyFormat, key: CryptoKey): Promise[Any]

Returns a Promise of a buffer containing the key in the format requested.

Returns a Promise of a buffer containing the key in the format requested.

Defined at ¶14.3.10 The exportKey method

def generateKey(algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: Array[KeyUsage]): Promise[Any]

Returns a Promise of a newly generated CryptoKey, for symmetrical algorithms, or a CryptoKeyPair, containing two newly generated keys, for asymmetrical algorithm, that matches the algorithm, the usages and the extractability given as parameters. MDN

Returns a Promise of a newly generated CryptoKey, for symmetrical algorithms, or a CryptoKeyPair, containing two newly generated keys, for asymmetrical algorithm, that matches the algorithm, the usages and the extractability given as parameters. MDN

Defined at ¶14.3.6 The generateKey method

We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier rather than an AlgorithmIdentifier for the algorithm field.

def importKey(format: KeyFormat, keyData: BufferSource, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: Array[KeyUsage]): Promise[Any]

Returns a Promise of a CryptoKey corresponding to the format, the algorithm, the raw key data, the usages and the extractability given as parameters. MDN

Returns a Promise of a CryptoKey corresponding to the format, the algorithm, the raw key data, the usages and the extractability given as parameters. MDN

Defined at ¶14.3.9 The importKey method

We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier rather than an AlgorithmIdentifier for the algorithm field.

def importKey(format: KeyFormat, keyData: JsonWebKey, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: Array[KeyUsage]): Promise[Any]

Returns a Promise of a CryptoKey corresponding to the format, the algorithm, the raw key data, the usages and the extractability given as parameters. MDN

Returns a Promise of a CryptoKey corresponding to the format, the algorithm, the raw key data, the usages and the extractability given as parameters. MDN

Defined at ¶14.3.9 The importKey method

We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier rather than an AlgorithmIdentifier for the algorithm field.

def sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): Promise[Any]

Returns a Promise of the signature corresponding to the text, algorithm and key given as parameters. MDN

Returns a Promise of the signature corresponding to the text, algorithm and key given as parameters. MDN

Defined at ¶14.3.3 The sign method

def unwrapKey(format: String, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: Boolean, keyUsages: Array[KeyUsage]): Promise[Any]

Returns a Promise of a CryptoKey corresponding to the wrapped key given in parameter. MDN

Returns a Promise of a CryptoKey corresponding to the wrapped key given in parameter. MDN

Defined at ¶14.3.12 The unwrapKey method

We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier rather than an AlgorithmIdentifier.

def verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise[Any]

Returns a Promise of a Boolean value indicating if the signature given as parameter matches the text, algorithm and key also given as parameters. MDN

Returns a Promise of a Boolean value indicating if the signature given as parameter matches the text, algorithm and key also given as parameters. MDN

Defined at ¶14.3.4 The verify method

def wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): Promise[Any]

Returns a Promise of a wrapped symmetric key for usage (transfer, storage) in unsecure environments. The wrapped buffer returned is in the format given in parameters, and contained the key wrapped by the give wrapping key with the given algorithm.

Returns a Promise of a wrapped symmetric key for usage (transfer, storage) in unsecure environments. The wrapped buffer returned is in the format given in parameters, and contained the key wrapped by the give wrapping key with the given algorithm.

Defined at ¶14.3.11 The wrapKey method

Inherited methods

def hasOwnProperty(v: String): Boolean
Inherited from
Object
def isPrototypeOf(v: Object): Boolean
Inherited from
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from
Object
def toLocaleString(): String
Inherited from
Object
def valueOf(): Any
Inherited from
Object