Constructor
new CryptoApi(encryptionKeyPair, signKeyPair)
Parameters:
Name | Type | Description |
---|---|---|
encryptionKeyPair |
KeyPair | keypair for encryption |
signKeyPair |
SignKeyPair | keypair for signing |
Construct a new crypt api wrapper.
- Source:
Classes
Methods
encrypt(data, otherPublicKey, nonce) → {Uint8Array}
Parameters:
Name | Type | Description |
---|---|---|
data |
Uint8Array | |
otherPublicKey |
PublicKey | |
nonce |
Nonce |
Same as encryption.ts:encrypt
- Source:
Returns:
Type: Uint8Array
encryptAndEmbedNonce(data, otherPublicKey, nonce) → {Uint8Array}
Parameters:
Name | Type | Description |
---|---|---|
data |
Uint8Array | |
otherPublicKey |
PublicKey | |
nonce |
Nonce |
Same as encryption.ts:encryptAndEmbedNonce
- Source:
Returns:
Type: Uint8Array
decrypt(cypher, otherPublicKey, nonce) → {Uint8Array}
Parameters:
Name | Type | Description |
---|---|---|
cypher |
Uint8Array | |
otherPublicKey |
PublicKey | |
nonce |
Nonce |
Same as encryption.ts:decrypt
- Source:
Returns:
Type: Uint8Array
decryptWithEmbeddedNonce(cypherAndNonce, otherPublicKey) → {Uint8Array}
Parameters:
Name | Type | Description |
---|---|---|
cypherAndNonce |
Uint8Array | |
otherPublicKey |
PublicKey |
Same as encryption.ts:decryptWithEmbeddedNonce
- Source:
Returns:
Type: Uint8Array
createEncryptionApiWithPerson(otherPublicKey) → {EncryptionApi}
Parameters:
Name | Type | Description |
---|---|---|
otherPublicKey |
PublicKey |
Construct an encryption/decryption api based on the public key of someone else.
All encryption & decryption calls from this crypto API, require the public key of somebody else. By using the api returned by this function, you do not have to specify the key of the other side each time. This is also slightly faster if multiple functions are called, because this call derives the symmetric key only once.
- Source:
Returns:
Type: EncryptionApi
createEncryptionApiWithKeysAndPerson(otherPublicKey) → {SymmetricCryptoApi}
Parameters:
Name | Type | Description |
---|---|---|
otherPublicKey |
PublicKey |
Same as createCryptoApiWith, but we also store the public keys of the participants.
- Source:
Returns:
Type: SymmetricCryptoApi
sign(data) → {Uint8Array}
Parameters:
Name | Type | Description |
---|---|---|
data |
Uint8Array |
Sign the passed data.
This only returns the signature, not a complete signed message.
- Source:
Returns:
Type: Uint8Array