StrKey

StrKey

StrKey is a helper class that allows encoding and decoding DigitalBits keys to/from strings, i.e. between their binary (Buffer, xdr.PublicKey, etc.) and string (i.e. "GABCD...", etc.) representations.

Constructor

new StrKey()

Source:

Methods

(static) decodeEd25519PublicKey(data) → {Buffer}

Decodes strkey ed25519 public key to raw data.

If the parameter is a muxed account key ("M..."), this will only encode it as a basic Ed25519 key (as if in "G..." format).

Source:
Parameters:
Name Type Description
data string

"G..." (or "M...") key representation to decode

Returns:
Type:
Buffer

raw key

(static) decodeEd25519SecretSeed(data) → {Buffer}

Decodes strkey ed25519 seed to raw data.

Source:
Parameters:
Name Type Description
data string

data to decode

Returns:
Type:
Buffer

(static) decodeMed25519PublicKey(data) → {Buffer}

Decodes strkey med25519 public key to raw data.

Source:
Parameters:
Name Type Description
data string

data to decode

Returns:
Type:
Buffer

(static) decodePreAuthTx(data) → {Buffer}

Decodes strkey PreAuthTx to raw data.

Source:
Parameters:
Name Type Description
data string

data to decode

Returns:
Type:
Buffer

(static) decodeSha256Hash(data) → {Buffer}

Decodes strkey sha256 hash to raw data.

Source:
Parameters:
Name Type Description
data string

data to decode

Returns:
Type:
Buffer

(static) encodeEd25519PublicKey(data) → {string}

Encodes data to strkey ed25519 public key.

Source:
Parameters:
Name Type Description
data Buffer

raw data to encode

Returns:
Type:
string

"G..." representation of the key

(static) encodeEd25519SecretSeed(data) → {string}

Encodes data to strkey ed25519 seed.

Source:
Parameters:
Name Type Description
data Buffer

data to encode

Returns:
Type:
string

(static) encodeMed25519PublicKey(data) → {string}

Encodes data to strkey med25519 public key.

Source:
Parameters:
Name Type Description
data Buffer

data to encode

Returns:
Type:
string

(static) encodePreAuthTx(data) → {string}

Encodes data to strkey preAuthTx.

Source:
Parameters:
Name Type Description
data Buffer

data to encode

Returns:
Type:
string

(static) encodeSha256Hash(data) → {string}

Encodes data to strkey sha256 hash.

Source:
Parameters:
Name Type Description
data Buffer

data to encode

Returns:
Type:
string

(static) isValidEd25519PublicKey(publicKey) → {boolean}

Returns true if the given DigitalBits public key is a valid ed25519 public key.

Source:
Parameters:
Name Type Description
publicKey string

public key to check

Returns:
Type:
boolean

(static) isValidEd25519SecretSeed(seed) → {boolean}

Returns true if the given DigitalBits secret key is a valid ed25519 secret seed.

Source:
Parameters:
Name Type Description
seed string

seed to check

Returns:
Type:
boolean

(static) isValidMed25519PublicKey(publicKey) → {boolean}

Returns true if the given DigitalBits public key is a valid med25519 public key.

Source:
Parameters:
Name Type Description
publicKey string

public key to check

Returns:
Type:
boolean