PrivMX DOCS
API Reference/PrivMX Endpoint Swift/Crypto

ExtKey

ExtKey is a class representing Extended keys and operations on it. This class allows for safely using the underlying privmx.endpoint.crypto.ExtKey

Static Methods

fromSeed(seed:)

Creates ExtKey from given seed.

Params

seed

privmx.endpoint.core.Buffer

the seed used to generate Key

public static func fromSeed(
seed: privmx.endpoint.core.Buffer
) throws -> ExtKey

Returns

ExtKey · ExtKey object

fromBase58(base58:)

Decodes ExtKey from Base58 format.

Params

base58

std.string

the ExtKey in Base58

public static func fromBase58(
base58: std.string
) throws -> ExtKey

Returns

ExtKey · ExtKey object

generateRandom()

Generates a new ExtKey.

public static func generateRandom(
) throws -> ExtKey

Returns

ExtKey · ExtKey object

Methods

derive(index:)

Generates child ExtKey from a current ExtKey using BIP32.

Params

index

UInt32

number from 0 to 2^31-1

public func derive(
index:UInt32
) throws -> ExtKey

Returns

ExtKey · ExtKey object

deriveHardened(index:)

Generates hardened child ExtKey from a current ExtKey using BIP32.

Params

index

UInt32

number from 0 to 2^31-1

public func deriveHardened(
index:UInt32
) throws -> ExtKey

Returns

ExtKey · ExtKey object

getPrivatePartAsBase58()

Converts ExtKey to Base58 string.

public func getPrivatePartAsBase58(
) throws -> std.string

Returns

std.string · ExtKey in Base58 format

getPublicPartAsBase58()

Converts the public part of ExtKey to Base58 string.

public func getPublicPartAsBase58(
) throws -> std.string

Returns

std.string · ExtKey in Base58 format

getPrivateKey()

Extracts ECC PrivateKey.

public func getPrivateKey(
) throws -> std.string

Returns

std.string · ECC key in WIF format

getPublicKey()

Extracts ECC PublicKey.

public func getPublicKey(
) throws -> std.string

Returns

std.string · ECC key in BASE58DER format

getPublicKeyAsBase58Address()

Extracts ECC PublicKey Address.

public func getPublicKeyAsBase58Address(
) throws -> std.string

Returns

std.string · ECC Address in BASE58 format

getPrivateEncKey()

Extracts raw ECC PrivateKey.

public func getPrivateEncKey(
) throws -> privmx.endpoint.core.Buffer

Returns

privmx.endpoint.core.Buffer · ECC PrivateKey

getChainCode()

Gets the chain code of Extended Key.

public func getChainCode(
) throws -> privmx.endpoint.core.Buffer

Returns

privmx.endpoint.core.Buffer · Raw chain code

verifyCompactSignatureWithHash(message:signature:)

Validates a signature of a message.

Params

message

privmx.endpoint.core.Buffer

data used on validation

signature

privmx.endpoint.core.Buffer

signature of data to verify

public func verifyCompactSignatureWithHash(
message: privmx.endpoint.core.Buffer,
signature: privmx.endpoint.core.Buffer
) throws -> Bool

Returns

Bool · message validation result

isPrivate()

Checks if ExtKey is Private.

public func isPrivate(
) throws -> Bool

Returns

Bool · returns true if ExtKey is private

We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.

PrivMX Endpoint Swift v2.3

This package is not up to date with the core documentation. Some of the features you've seen described in other parts of the documentation might not be mentioned here. Those changes do not influence compatibility, however