Function
Static Public Summary | ||
public |
createCascadedData(data: *): * |
|
public |
createDecryptionCascade(objectPattern: {"keys": *, "encrypted": *}): * |
|
public |
createEncryptedMessage(suite: *, keyType: *, message: *, options: {}): * |
|
public |
async createEncryptionCascade(objectPattern: {"keys": *, "procedure": *}): * |
|
public |
createKeyId(keyId: *): * |
|
public |
createKeyIdList(keyIds: *): * |
|
public |
createRawEncryptedMessage(data: *, keyId: *, params: *): * |
|
public |
createRawSignature(sig: *, keyId: *): * |
|
public |
createSignature(suite: *, keyType: *, signatures: *, options: {}): * |
|
public |
Decrypt given message and additionally verify attached signatures simultaneously. |
|
public |
async encrypt(message: *, keys: *, config: *): Promise<{success: boolean, status: string, data: any}>{success:> Basic encryption API that enables signing simultaneously with encrypting message. |
|
public |
async fromJscuKey(keyObject: *, len: *): Promise<KeyId> Calculate key Id from jwk-formatted key Key id is defined as jwk public key thumbprint (NOTE: not private key thumbprint) see the spec here => https://tools.ietf.org/html/rfc7638 |
|
public |
async fromRawKey(bin: *, len: *): Promise<KeyId> Just a hash of raw binary key |
|
public |
async generateKey(keyParams: *): Promise<*> Generate key (pair). |
|
public |
async generateKeyObject(keyParams: *): Promise<*> Basic key generator via jscu APIs. |
|
public |
getJscu(): * utils.js |
|
public |
importCascadedBuffer(serialized: *): * |
|
public |
importEncryptedBuffer(serialized: *): * |
|
public |
async importKeys(format: *, keys: *, suite: *, mode: *): Promise<Keys> Functions to import keys and translate them to suite-specific key objects. |
|
public |
importMessage(msg: *): Message import message and translate it to message object. |
|
public |
importRawEncryptedBufferList(array: *): * |
|
public |
importSignatureBuffer(serialized: *): * |
|
public |
Returns the signature objects. |
|
public |
Returns verification result |
Static Public
public createCascadedData(data: *): * source
import {createCascadedData} from 'crypto-cascade/src/cascaded_data.js'
Params:
Name | Type | Attribute | Description |
data | * |
Return:
* |
public createDecryptionCascade(objectPattern: {"keys": *, "encrypted": *}): * source
import {createDecryptionCascade} from 'crypto-cascade/src/cascade.js'
Params:
Name | Type | Attribute | Description |
objectPattern | {"keys": *, "encrypted": *} |
|
Return:
* |
public createEncryptedMessage(suite: *, keyType: *, message: *, options: {}): * source
import {createEncryptedMessage} from 'crypto-cascade/src/encrypted_message.js'
Params:
Name | Type | Attribute | Description |
suite | * | ||
keyType | * | ||
message | * | ||
options | {} |
|
Return:
* |
public async createEncryptionCascade(objectPattern: {"keys": *, "procedure": *}): * source
import {createEncryptionCascade} from 'crypto-cascade/src/cascade.js'
Params:
Name | Type | Attribute | Description |
objectPattern | {"keys": *, "procedure": *} |
|
Return:
* |
public createKeyId(keyId: *): * source
import {createKeyId} from 'crypto-cascade/src/keyid.js'
Params:
Name | Type | Attribute | Description |
keyId | * |
Return:
* |
public createKeyIdList(keyIds: *): * source
import {createKeyIdList} from 'crypto-cascade/src/keyid.js'
Params:
Name | Type | Attribute | Description |
keyIds | * |
Return:
* |
public createRawEncryptedMessage(data: *, keyId: *, params: *): * source
import {createRawEncryptedMessage} from 'crypto-cascade/src/encrypted_message.js'
Params:
Name | Type | Attribute | Description |
data | * | ||
keyId | * | ||
params | * |
Return:
* |
public createRawSignature(sig: *, keyId: *): * source
import {createRawSignature} from 'crypto-cascade/src/signature.js'
Params:
Name | Type | Attribute | Description |
sig | * | ||
keyId | * |
Return:
* |
public createSignature(suite: *, keyType: *, signatures: *, options: {}): * source
import {createSignature} from 'crypto-cascade/src/signature.js'
Params:
Name | Type | Attribute | Description |
suite | * | ||
keyType | * | ||
signatures | * | ||
options | {} |
|
Return:
* |
public async decrypt(data: *, keys: *): Promise<*> source
import {decrypt} from 'crypto-cascade/src/core.js'
Decrypt given message and additionally verify attached signatures simultaneously.
Params:
Name | Type | Attribute | Description |
data | * | ||
keys | * |
public async encrypt(message: *, keys: *, config: *): Promise<{success: boolean, status: string, data: any}>{success:> source
import {encrypt} from 'crypto-cascade/src/core.js'
Basic encryption API that enables signing simultaneously with encrypting message.
Params:
Name | Type | Attribute | Description |
message | * | ||
keys | * | ||
config | * |
public async fromJscuKey(keyObject: *, len: *): Promise<KeyId> source
import {fromJscuKey} from 'crypto-cascade/src/keyid.js'
Calculate key Id from jwk-formatted key Key id is defined as jwk public key thumbprint (NOTE: not private key thumbprint) see the spec here => https://tools.ietf.org/html/rfc7638
Params:
Name | Type | Attribute | Description |
keyObject | * | ||
len | * |
public async fromRawKey(bin: *, len: *): Promise<KeyId> source
import {fromRawKey} from 'crypto-cascade/src/keyid.js'
Just a hash of raw binary key
Params:
Name | Type | Attribute | Description |
bin | * | ||
len | * |
public async generateKey(keyParams: *): Promise<*> source
import {generateKey} from 'crypto-cascade/src/core.js'
Generate key (pair). This API must be called externally.
Params:
Name | Type | Attribute | Description |
keyParams | * | {object}: a parameter to generate keys in the form of like Simple Crypto Suite using WebCryptoAPI/OpenSSL: { suite: 'jscu', passphrase: 'omg', keyParams: {type: 'ECC', curve} } } |
public async generateKeyObject(keyParams: *): Promise<*> source
import {generateKeyObject} from 'crypto-cascade/src/keys.js'
Basic key generator via jscu APIs. Returns raw objects of keys in both environments from the spec with some additional args.
Params:
Name | Type | Attribute | Description |
keyParams | * |
public importCascadedBuffer(serialized: *): * source
import {importCascadedBuffer} from 'crypto-cascade/src/cascaded_data.js'
Params:
Name | Type | Attribute | Description |
serialized | * |
Return:
* |
public importEncryptedBuffer(serialized: *): * source
import {importEncryptedBuffer} from 'crypto-cascade/src/encrypted_message.js'
Params:
Name | Type | Attribute | Description |
serialized | * |
Return:
* |
public async importKeys(format: *, keys: *, suite: *, mode: *): Promise<Keys> source
import {importKeys} from 'crypto-cascade/src/keys.js'
Functions to import keys and translate them to suite-specific key objects.
Params:
Name | Type | Attribute | Description |
format | * | ||
keys | * | ||
suite | * | ||
mode | * |
public importMessage(msg: *): Message source
import {importMessage} from 'crypto-cascade/src/message.js'
import message and translate it to message object.
Params:
Name | Type | Attribute | Description |
msg | * |
Return:
Message |
public importRawEncryptedBufferList(array: *): * source
import {importRawEncryptedBufferList} from 'crypto-cascade/src/encrypted_message.js'
Params:
Name | Type | Attribute | Description |
array | * |
Return:
* |
public importSignatureBuffer(serialized: *): * source
import {importSignatureBuffer} from 'crypto-cascade/src/signature.js'
Params:
Name | Type | Attribute | Description |
serialized | * |
Return:
* |
public async sign(message: *, keys: *, config: *): Promise<*>*> source
import {sign} from 'crypto-cascade/src/core.js'
Returns the signature objects.
Params:
Name | Type | Attribute | Description |
message | * | ||
keys | * | ||
config | * |
public async verify(message: *, signature: *, keys: *): Promise<*> source
import {verify} from 'crypto-cascade/src/core.js'
Returns verification result
Params:
Name | Type | Attribute | Description |
message | * | ||
signature | * | ||
keys | * |