In Document and Typing of tagged encryption:
/**
* This function encrtps user`s CID and shared symetric keys
* @function encrypt()
* @property symetricKey: string, CID: string, didAudience: array
* @returns jwe {}
*/
async encrypt(symetricKey: string, CID: string, didAudience: Array<string>): Promise<any> {
return await this._did.createDagJWE({ symetricKey: symetricKey, CID: CID}, didAudience)
}
/**
* This function encrtps user`s CID and shared symetric keys
* @function decrypt()
* @property jwe {}
* @returns decrypted message {symetricKey: string, CID: string}
*/
async decrypt(jwe: any): Promise<any> {
return await this._did.decryptDagJWE(jwe);
}
symetricKey is String but in example/gallery/fula-sec/react-app
symetricKey is an object
const tagged = new TaggedEncryption(userDID?.did)
let plaintext = {
symmetricKey: key,
CID: cid
}
let jwe = await tagged?.encrypt(plaintext.symmetricKey, plaintext.CID, [userDID?.did?.id])
In Document and Typing of tagged encryption:
symetricKeyis String but inexample/gallery/fula-sec/react-appsymetricKey is an object