CryptoEngine
Default cryptographic engine for Web Cryptography API
Constructor Summary
Public Constructor | ||
public |
constructor(parameters: Object) Constructor for CryptoEngine class |
Method Summary
Public Methods | ||
public |
convert(inputFormat: string, outputFormat: string, keyData: ArrayBuffer | Object, algorithm: Object, extractable: boolean, keyUsages: Array): Promise Convert WebCrypto keys between different export formats |
|
public |
Wrapper for standard function "decrypt" |
|
public |
decryptEncryptedContentInfo(parameters: *): Promise Decrypt data stored in "EncryptedContentInfo" object using parameters |
|
public |
deriveBits(args: *): Promise Wrapper for standard function "deriveBits" |
|
public |
Wrapper for standard function "deriveKey" |
|
public |
Wrapper for standard function "digest" |
|
public |
Wrapper for standard function "encrypt" |
|
public |
encryptEncryptedContentInfo(parameters: Object): Promise Specialized function encrypting "EncryptedContentInfo" object using parameters |
|
public |
Export WebCrypto keys to different formats |
|
public |
fillPublicKeyParameters(publicKeyInfo: *, signatureAlgorithm: *): * |
|
public |
generateKey(args: *): Promise Wrapper for standard function "generateKey" |
|
public |
getAlgorithmByOID(oid: string): Object Get WebCrypto algorithm by wel-known OID |
|
public |
getAlgorithmParameters(algorithmName: string, operation: string): * Get default algorithm parameters for each kind of operation |
|
public |
getHashAlgorithm(signatureAlgorithm: AlgorithmIdentifier): string Getting hash algorithm by signature algorithm |
|
public |
getOIDByAlgorithm(algorithm: Object): string Get OID for each specific algorithm |
|
public |
getPublicKey(publicKeyInfo: *, signatureAlgorithm: *, parameters: undefined): * |
|
public |
getRandomValues(view: Uint8Array): * Initialize input Uint8Array by random values (with help from current "crypto engine") |
|
public |
getSignatureParameters(privateKey: Object, hashAlgorithm: string): Promise<T> | Promise Get signature parameters by analyzing private key algorithm |
|
public |
importKey(format: string, keyData: ArrayBuffer | Uint8Array, algorithm: Object, extractable: boolean, keyUsages: Array): Promise Import WebCrypto keys from different formats |
|
public |
Wrapper for standard function "sign" |
|
public |
signWithPrivateKey(data: ArrayBuffer, privateKey: Object, parameters: Object): Promise<T> | Promise Sign data with pre-defined private key |
|
public |
stampDataWithPassword(parameters: Object): Promise<T> | Promise Stamping (signing) data using algorithm simular to HMAC |
|
public |
Wrapper for standard function "unwrapKey" |
|
public |
Wrapper for standard function "verify" |
|
public |
verifyDataStampedWithPassword(parameters: *): * |
|
public |
verifyWithPublicKey(data: *, signature: *, publicKeyInfo: *, signatureAlgorithm: *, shaAlgorithm: undefined): * |
|
public |
Wrapper for standard function "wrapKey" |
Public Constructors
Public Methods
public convert(inputFormat: string, outputFormat: string, keyData: ArrayBuffer | Object, algorithm: Object, extractable: boolean, keyUsages: Array): Promise source
Convert WebCrypto keys between different export formats
public decrypt(args: *): Promise source
Wrapper for standard function "decrypt"
Params:
Name | Type | Attribute | Description |
args | * |
public decryptEncryptedContentInfo(parameters: *): Promise source
Decrypt data stored in "EncryptedContentInfo" object using parameters
Params:
Name | Type | Attribute | Description |
parameters | * |
public deriveBits(args: *): Promise source
Wrapper for standard function "deriveBits"
Params:
Name | Type | Attribute | Description |
args | * |
public deriveKey(args: *): Promise source
Wrapper for standard function "deriveKey"
Params:
Name | Type | Attribute | Description |
args | * |
public digest(args: *): Promise source
Wrapper for standard function "digest"
Params:
Name | Type | Attribute | Description |
args | * |
public encrypt(args: *): Promise source
Wrapper for standard function "encrypt"
Params:
Name | Type | Attribute | Description |
args | * |
public encryptEncryptedContentInfo(parameters: Object): Promise source
Specialized function encrypting "EncryptedContentInfo" object using parameters
Params:
Name | Type | Attribute | Description |
parameters | Object |
public exportKey(format: string, key: Object): Promise source
Export WebCrypto keys to different formats
public fillPublicKeyParameters(publicKeyInfo: *, signatureAlgorithm: *): * source
Params:
Name | Type | Attribute | Description |
publicKeyInfo | * | ||
signatureAlgorithm | * |
Return:
* |
public generateKey(args: *): Promise source
Wrapper for standard function "generateKey"
Params:
Name | Type | Attribute | Description |
args | * |
public getAlgorithmByOID(oid: string): Object source
Get WebCrypto algorithm by wel-known OID
Params:
Name | Type | Attribute | Description |
oid | string | well-known OID to search for |
public getAlgorithmParameters(algorithmName: string, operation: string): * source
Get default algorithm parameters for each kind of operation
Return:
* |
public getHashAlgorithm(signatureAlgorithm: AlgorithmIdentifier): string source
Getting hash algorithm by signature algorithm
Params:
Name | Type | Attribute | Description |
signatureAlgorithm | AlgorithmIdentifier | Signature algorithm |
public getOIDByAlgorithm(algorithm: Object): string source
Get OID for each specific algorithm
Params:
Name | Type | Attribute | Description |
algorithm | Object |
public getPublicKey(publicKeyInfo: *, signatureAlgorithm: *, parameters: undefined): * source
Params:
Name | Type | Attribute | Description |
publicKeyInfo | * | ||
signatureAlgorithm | * | ||
parameters | undefined |
|
Return:
* |
public getRandomValues(view: Uint8Array): * source
Initialize input Uint8Array by random values (with help from current "crypto engine")
Params:
Name | Type | Attribute | Description |
view | Uint8Array |
|
Return:
* |
public getSignatureParameters(privateKey: Object, hashAlgorithm: string): Promise<T> | Promise source
Get signature parameters by analyzing private key algorithm
public importKey(format: string, keyData: ArrayBuffer | Uint8Array, algorithm: Object, extractable: boolean, keyUsages: Array): Promise source
Import WebCrypto keys from different formats
Params:
Name | Type | Attribute | Description |
format | string | ||
keyData | ArrayBuffer | Uint8Array | ||
algorithm | Object | ||
extractable | boolean | ||
keyUsages | Array |
public sign(args: *): Promise source
Wrapper for standard function "sign"
Params:
Name | Type | Attribute | Description |
args | * |
public signWithPrivateKey(data: ArrayBuffer, privateKey: Object, parameters: Object): Promise<T> | Promise source
Sign data with pre-defined private key
Params:
Name | Type | Attribute | Description |
data | ArrayBuffer | Data to be signed |
|
privateKey | Object | Private key to use |
|
parameters | Object | Parameters for used algorithm |
public stampDataWithPassword(parameters: Object): Promise<T> | Promise source
Stamping (signing) data using algorithm simular to HMAC
Params:
Name | Type | Attribute | Description |
parameters | Object |
public unwrapKey(args: *): Promise source
Wrapper for standard function "unwrapKey"
Params:
Name | Type | Attribute | Description |
args | * |
public verify(args: *): Promise source
Wrapper for standard function "verify"
Params:
Name | Type | Attribute | Description |
args | * |
public verifyDataStampedWithPassword(parameters: *): * source
Params:
Name | Type | Attribute | Description |
parameters | * |
Return:
* |