@celo/utils"packages/sdk/utils/src/dataEncryptionKey"

Module: "packages/sdk/utils/src/dataEncryptionKey"

Index

Functions

Object literals

Functions

compressedPubKey

compressedPubKey(privateKey: Buffer): string

Defined in packages/sdk/utils/src/dataEncryptionKey.ts:10

Turns a private key to a compressed public key (hex string with hex leader).

Parameters:

Name Type Description
privateKey Buffer Private key.

Returns: string

Corresponding compessed public key in hex encoding with '0x' leader.


decompressPublicKey

decompressPublicKey(publicKey: Buffer): Buffer

Defined in packages/sdk/utils/src/dataEncryptionKey.ts:27

Decompresses a public key and strips out the '0x04' leading constant. This makes any public key suitable to be used with this ECIES implementation.

Parameters:

Name Type Description
publicKey Buffer Public key in standard form (with 0x02, 0x03, or 0x04 prefix)

Returns: Buffer

Decompresssed public key without prefix.


deriveDek

deriveDek(mnemonic: string, bip39ToUse?: Bip39): Promise‹object›

Defined in packages/sdk/utils/src/dataEncryptionKey.ts:42

Derives a data encryption key from the mnemonic

Parameters:

Name Type
mnemonic string
bip39ToUse? Bip39

Returns: Promise‹object›

Comment Encryption Private key.

Object literals

Const DataEncryptionKeyUtils

DataEncryptionKeyUtils: object

Defined in packages/sdk/utils/src/dataEncryptionKey.ts:56

compressedPubKey

compressedPubKey: compressedPubKey

Defined in packages/sdk/utils/src/dataEncryptionKey.ts:57

decompressPublicKey

decompressPublicKey: decompressPublicKey

Defined in packages/sdk/utils/src/dataEncryptionKey.ts:58

deriveDek

deriveDek: deriveDek

Defined in packages/sdk/utils/src/dataEncryptionKey.ts:59