AbstractCryptoService

AbstractCryptoService ⇐ Abstract

Kind: global abstract class
Extends: Abstract
Service:
Properties

NameTypeDescription
_savedKeysObject

Cache for all imported keys

AbstractCryptoService()

Service to provide low-level cryptographic functions

importKey(keyId, key) ⇒ Promise

Imports a key

Kind: instance method of AbstractCryptoService

ParamTypeDescription
keyIdString

Unique identifier for the key

keyObject

Object that describe a key

key.formatString

Describe the data format of the key, value coming from CryptoKeyFormat

key.dataArrayBuffer | TypedArray | DataView

Objet containing the key in the given format

key.algorithmCryptoAlgorithm

Defining the type of key, should be one of defined algorithm

key.exportableBoolean

Indicate if it will be possible to export the key

key.usagesArray.<String>

Array that indicate what can be done with the key, strings should come from CryptoUsage

exportKey(keyId, format) ⇒ Promise

Exports an existing key in the requested format

Kind: instance method of AbstractCryptoService

ParamTypeDescription
keyIdString

Unique key identifier

formatString

Describe the data format of the key, value coming from CryptoKeyFormat

encrypt(data, keyId, algorithm) ⇒ Promise

Encrypts data

Kind: instance method of AbstractCryptoService

ParamTypeDescription
dataArrayBuffer | TypedArray | DataView

Data to be encrypted

keyIdString

Unique key identifier to be used for encryption

algorithmCryptoAlgorithm

Algorithm to be used to be used, should be one of defined algorithm

sign(data, keyId, algorithm) ⇒ Promise

Sign data

Kind: instance method of AbstractCryptoService

ParamTypeDescription
dataArrayBuffer | TypedArray | DataView

Data to be signed

keyIdString

Unique key identifier to be used for signature

algorithmCryptoAlgorithm

Algorithm to be used to be used, should be one of defined algorithm

digest(data, algorithm) ⇒ Promise

Digest data

Kind: instance method of AbstractCryptoService

ParamTypeDescription
dataArrayBuffer | TypedArray | DataView

Data to be digest

algorithmString

Hash name function coming from CryptoDigestAlgorithm

__isCompleteKey(key) ⇒ Boolean

Check that parameters key has all the required properties

Kind: instance method of AbstractCryptoService

ParamTypeDescription
keyObject

Object to be checked

_importKey(format, data, algorithm, exportable, usages) ⇒ Promise

Implementation of import key

Kind: instance abstract method of AbstractCryptoService

ParamTypeDescription
formatString

Describe the data format of the key, value coming from CryptoKeyFormat

dataArrayBuffer | TypedArray | DataView

Objet containing the key in the given format

algorithmCryptoAlgorithm

Defining the algorithm of key

exportableboolean

Indicate if it will be possible to exporte the key

usagesArray.<String>

Array that indicate what can be done with the key, strings should come from CryptoUsage

_exportKey(key, format) ⇒ Promise

Implementation of export key

Kind: instance abstract method of AbstractCryptoService

ParamTypeDescription
key*

Native key

formatString

Describe the data format of the key, value coming from CryptoKeyFormat

_encrypt(data, key, algorithm) ⇒ Promise

Implementation of encrypt

Kind: instance abstract method of AbstractCryptoService

ParamTypeDescription
dataArrayBuffer | TypedArray | DataView

Data to encrypt

key*

Native key used for encryption

algorithmCryptoAlgorithm

Algorithm to be used

_sign(data, key, algorithm) ⇒ Promise

Implementation of sign

Kind: instance abstract method of AbstractCryptoService

ParamTypeDescription
dataArrayBuffer | TypedArray | DataView

Data to encrypt

key*

Native key used for encryption

algorithmCryptoAlgorithm

Algorithm to be used

_digest(data, algorithm) ⇒ Promise

Implementation of digest

Kind: instance abstract method of AbstractCryptoService

ParamTypeDescription
dataArrayBuffer | TypedArray | DataView

Data to digest

algorithmString

Hash name function coming from CryptoDigestAlgorithm

CryptoAlgorithm : HmacAlgorithm | RsaOaepAlgorithm | AesCbcAlgorithm

A type of Algorithm

Kind: inner typedef of AbstractCryptoService