decrypt

Decrypt data with Dashboard encryption api.

decrypt method returns a promise which resolves when Dashboard successfully decrypted your payload and rejects if missing requirements or if something went wrong with Dashboard encryption api.

How to use

import { Plugin } from '@root'

Plugin.decrypt({
    ...DECRYPT_PARAMS
}).then(data).catch(error)

Decrypt params

Param

Typeof

Default

Required

Description

payload

String

null

the data that you want Dashboard to decrypt for you.

password

String

null

the decryption password to use to decrypt your data.

Examples

Decrypt data

import { Plugin } from '@root'

const encryptedData = "elkrjkelwrj#RJGSDG=!fDSFJFSDjfsdihjge==!!DFEhg"

Plugin.decrypt({
    payload: encryptedData,
    password: 'my-super-secret-password'
}).then(decryptedData => {
    console.log(decryptedData)
}).catch(error => {
    console.error(error)
})

Last updated