Class: abstract
Secret
Extends
Serializable
Extended by
Constructors
new Secret()
new Secret(
type
,purposeId
):Secret
Parameters
• type: Type
• purposeId: number
Returns
Overrides
Serializable.constructor
Defined in
@nimiq/core/lib/index.d.ts:183
Properties
ENCRYPTION_CHECKSUM_SIZE
static
ENCRYPTION_CHECKSUM_SIZE:number
Defined in
@nimiq/core/lib/index.d.ts:181
ENCRYPTION_CHECKSUM_SIZE_V3
static
ENCRYPTION_CHECKSUM_SIZE_V3:number
Defined in
@nimiq/core/lib/index.d.ts:182
ENCRYPTION_KDF_ROUNDS
static
ENCRYPTION_KDF_ROUNDS:number
Defined in
@nimiq/core/lib/index.d.ts:180
ENCRYPTION_SALT_SIZE
static
ENCRYPTION_SALT_SIZE:number
Defined in
@nimiq/core/lib/index.d.ts:179
SIZE
static
SIZE:number
Defined in
@nimiq/core/lib/index.d.ts:178
Accessors
encryptedSize
Get Signature
get encryptedSize():
number
Returns the serialized size of this object when encrypted.
Returns
number
Defined in
@nimiq/core/lib/index.d.ts:196
Methods
compare()
compare(
o
):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.
Parameters
• o: Serializable
Returns
number
Inherited from
Serializable.compare
Defined in
@nimiq/core/lib/index.d.ts:97
equals()
equals(
o
):boolean
Checks for equality with another Serializable.
Parameters
• o: unknown
Returns
boolean
Inherited from
Serializable.equals
Defined in
@nimiq/core/lib/index.d.ts:91
exportEncrypted()
exportEncrypted(
key
):Promise
<SerialBuffer
>
Encrypts the Secret with a password.
Parameters
• key: Uint8Array
Returns
Promise
<SerialBuffer
>
Defined in
@nimiq/core/lib/index.d.ts:192
serialize()
abstract
serialize(buf
?):SerialBuffer
Parameters
• buf?: SerialBuffer
Returns
Inherited from
Serializable.serialize
Defined in
@nimiq/core/lib/index.d.ts:98
toBase64()
toBase64():
string
Formats the object into a base64 string.
Returns
string
Inherited from
Serializable.toBase64
Defined in
@nimiq/core/lib/index.d.ts:106
toHex()
toHex():
string
Formats the object into a hex string.
Returns
string
Inherited from
Serializable.toHex
Defined in
@nimiq/core/lib/index.d.ts:110
toString()
toString():
string
Formats the object into a hex string.
Returns
string
Inherited from
Serializable.toString
Defined in
@nimiq/core/lib/index.d.ts:102
exportEncrypted()
static
exportEncrypted(secret
,key
):Promise
<SerialBuffer
>
Parameters
• secret: PrivateKey
| Secret
• key: Uint8Array
Returns
Promise
<SerialBuffer
>
Defined in
@nimiq/core/lib/index.d.ts:188
fromEncrypted()
static
fromEncrypted(buf
,key
):Promise
<PrivateKey
|Entropy
>
Decrypts a Secret from an encrypted byte array and its password.
Parameters
• buf: SerialBuffer
• key: Uint8Array
Returns
Promise
<PrivateKey
| Entropy
>
Defined in
@nimiq/core/lib/index.d.ts:187