MsrBrowserCrypto class
Methods
Method Details
digest(AlgorithmIdentifier, Uint8Array)
function digest(algorithm: AlgorithmIdentifier, data: Uint8Array): Promise<ArrayBuffer>
Parameters
- algorithm
-
AlgorithmIdentifier
- data
-
Uint8Array
Returns
Promise<ArrayBuffer>
exportKey(CryptoKey)
function exportKey(key: CryptoKey): Promise<JsonWebKey>
Parameters
- key
-
CryptoKey
Returns
Promise<JsonWebKey>
generateKey(RsaHashedKeyGenParams, boolean, KeyUsage[])
function generateKey(algorithm: RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>
Parameters
- algorithm
-
RsaHashedKeyGenParams
- extractable
-
boolean
- keyUsages
-
KeyUsage[]
Returns
Promise<CryptoKeyPair>
getRandomValues(Uint8Array)
function getRandomValues(dataBuffer: Uint8Array): Uint8Array
Parameters
- dataBuffer
-
Uint8Array
Returns
Uint8Array
importKey(JsonWebKey, RsaHashedImportParams, boolean, KeyUsage[])
function importKey(keyData: JsonWebKey, algorithm: RsaHashedImportParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>
Parameters
- keyData
-
JsonWebKey
- algorithm
-
RsaHashedImportParams
- extractable
-
boolean
- keyUsages
-
KeyUsage[]
Returns
Promise<CryptoKey>
initPrng(Uint8Array)
function initPrng(entropy: Uint8Array)
Parameters
- entropy
-
Uint8Array
sign(AlgorithmIdentifier, CryptoKey, ArrayBuffer)
function sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: ArrayBuffer): Promise<ArrayBuffer>
Parameters
- algorithm
-
AlgorithmIdentifier
- key
-
CryptoKey
- data
-
ArrayBuffer
Returns
Promise<ArrayBuffer>