decryptPost
Decrypts the content of an encrypted post
.
How to use?
content
can be obtained using getPosts
or getPost
methods.
const res = await orbis.decryptPost(content);
Parameters
content
- object containing post's encrypted contentsencryptedBody
-object
JSON object containing the encryption detailsencryptedString
-string
Encrypted string generated by Lit ProtocolencryptedSymmetricKey
-string
Encrypted symmetric key generated by Lit ProtocolaccessControlConditions
-string
Array of access control conditions stored as a string
Returns
{
result: "Content of the decrypted post"
}
Examples
Fetch a post and decrypt it
const { data, error } = await orbis.getPost("k...")
if(error) throw error
const unencryptedPost = await orbis.decryptPost(data.content)
console.log("Unencrypted content:", unencryptedPost.result)