EncryptedPersistence
Class: EncryptedPersistence
EncryptedPersistence is a Persistence implementation that uses ECIES to encrypt all values ECIES encryption protects against unauthorized reads, but not unauthorized writes. A third party with access to the underlying store could write malicious data using the public key of the owner
Implements
Constructors
constructor
new EncryptedPersistence(persistence
, privateKey
)
Parameters
Name | Type |
---|---|
persistence | Persistence |
privateKey | SignedPrivateKey | PrivateKey |
Defined in
keystore/persistence/EncryptedPersistence.ts:20
Properties
persistence
Private
persistence: Persistence
Defined in
keystore/persistence/EncryptedPersistence.ts:15
privateKey
Private
privateKey: SignedPrivateKey
| PrivateKey
Defined in
keystore/persistence/EncryptedPersistence.ts:16
privateKeyBytes
Private
privateKeyBytes: Buffer
Defined in
keystore/persistence/EncryptedPersistence.ts:17
publicKey
Private
publicKey: Buffer
Defined in
keystore/persistence/EncryptedPersistence.ts:18
Methods
decrypt
Private
decrypt(value
): Promise
<Uint8Array
>
Parameters
Name | Type |
---|---|
value | Uint8Array |
Returns
Promise
<Uint8Array
>
Defined in
keystore/persistence/EncryptedPersistence.ts:48
deserializeEcies
Private
deserializeEcies(data
): Promise
<Ecies
>
Parameters
Name | Type |
---|---|
data | Uint8Array |
Returns
Promise
<Ecies
>
Defined in
keystore/persistence/EncryptedPersistence.ts:60
encrypt
Private
encrypt(value
): Promise
<Uint8Array
>
Parameters
Name | Type |
---|---|
value | Uint8Array |
Returns
Promise
<Uint8Array
>
Defined in
keystore/persistence/EncryptedPersistence.ts:43
getItem
getItem(key
): Promise
<null
| Uint8Array
>
Parameters
Name | Type |
---|---|
key | string |
Returns
Promise
<null
| Uint8Array
>
Implementation of
Defined in
keystore/persistence/EncryptedPersistence.ts:30
serializeEcies
Private
serializeEcies(data
): Promise
<Uint8Array
>
Parameters
Name | Type |
---|---|
data | Ecies |
Returns
Promise
<Uint8Array
>
Defined in
keystore/persistence/EncryptedPersistence.ts:54
setItem
setItem(key
, value
): Promise
<void
>
Parameters
Name | Type |
---|---|
key | string |
value | Uint8Array |
Returns
Promise
<void
>