Static
ENCRYPTION_Static
SIGNING_Static
STORAGE_Decrypt the given message. Throws if the message does not contain a key for this device.
The message to decrypt
Generate a new AES key and use it to encrypt a message to the given recipients. The message author (this ID) is appended to the devices in the message, so the author will be able to decrypt the message.
Omit the recipients to create a self-encrypted message.
The thing to encrypt
Optional
recipients: SerializedIdentity[]The recipients
Static
createCreate a new Identity. Use this because async
.
Key names used for storing the main keypairs in indexedDB.
A new identity instance
Static
createCreate a new device record. This does not include an AES key in the device record, because typically you create a device record before adding this device to a different Identity, so you would add an AES key at that point.
A human-readable name for the device.
The device record without aes
key.
Static
initStatic
save
A class representing a user.
By default, includes two "main" keypairs, and a "main" AES key.
encryptionKey
-- asymmetric key for encryptingsigningKey
-- asymmetric key for signingThis will serialize some properties like a human-readable name to localStorage also. Choose the storage key by setting the static property
STORAGE_KEY
. The default isidentity
.