Classes

Secret

Extends

  • Serializable

Extended by

Constructors

new Secret()

new Secret(`type`, `purposeId`): [Secret](Secret)
ParameterType
Firstnumber
Returns
Secret

Overrides

Serializable.constructor

Properties

ENCRYPTION_CHECKSUM_SIZE

`static` ENCRYPTION\_CHECKSUM\_SIZE: `number`

ENCRYPTION_CHECKSUM_SIZE_V3

`static` ENCRYPTION\_CHECKSUM\_SIZE\_V3: `number`

ENCRYPTION_KDF_ROUNDS

`static` ENCRYPTION\_KDF\_ROUNDS: `number`

ENCRYPTION_SALT_SIZE

`static` ENCRYPTION\_SALT\_SIZE: `number`

SIZE

`static` SIZE: `number`

Accessors

encryptedSize

Get Signature

get encryptedSize(): `number`

Returns the serialized size of this object when encrypted.

Methods

compare()

compare(`param14`): `number`

Compares this object to another object.

Returns a negative number if this is smaller than o, a positive number if this is larger than o, and zero if equal.

ParameterType
FirstSerializable

Inherited from

Serializable.compare


equals()

equals(`param13`): `boolean`

Checks for equality with another Serializable.

ParameterType
Firstunknown

Inherited from

Serializable.equals


exportEncrypted()

exportEncrypted(`key`): `Promise`\<[SerialBuffer](SerialBuffer)\>

Encrypts the Secret with a password.

ParameterType
FirstUint8Array
<SerialBuffer>

serialize()

`abstract` serialize(`buf`?): [SerialBuffer](SerialBuffer)
ParameterType
FirstSerialBuffer

Inherited from

Serializable.serialize


toBase64()

toBase64(): `string`

Formats the object into a base64 string.

Inherited from

Serializable.toBase64


toHex()

toHex(): `string`

Formats the object into a hex string.

Inherited from

Serializable.toHex


toString()

toString(): `string`

Formats the object into a hex string.

Inherited from

Serializable.toString


exportEncrypted()

`static` exportEncrypted(`secret`, `key`): `Promise`\<[SerialBuffer](SerialBuffer)\>
ParameterType
FirstUint8Array
<SerialBuffer>

fromEncrypted()

`static` fromEncrypted(`buf`, `key`): `Promise`\<[Entropy](Entropy) \| `PrivateKey`\>

Decrypts a Secret from an encrypted byte array and its password.

ParameterType
FirstUint8Array
<Entropy | PrivateKey>