pub fn x_salsa20_poly1305_shared_secret_ingest(
recipient: X25519PubKey,
sender: X25519PubKey,
encrypted_data: XSalsa20Poly1305EncryptedData,
key_ref: Option<XSalsa20Poly1305KeyRef>
) -> ExternResult<XSalsa20Poly1305KeyRef>
Expand description
Using the Libsodium box algorithm, decrypt a shared secret, storing it
in the keystore so that it may be used in x_salsa20_poly1305_decrypt
.
This method may be co-opted to ingest shared secrets generated by other
custom means. Just be careful, as WASM memory is not a very secure
environment for cryptographic secrets.
If key_ref is None
an opaque reference string will be auto-generated.
If key_ref is Some
and that key already exists in the store,
this function will return an error.
If Ok
, this function will return the KeyRef by which the shared
secret may be accessed.