PrivateKey

public struct PrivateKey : Equatable

A Steem private key.

  • Create a new private key instance from a byte buffer.

    Declaration

    Swift

    public init?(_ data: Data)

    Parameters

    data

    The 33-byte private key where the first byte is the network id (0x80).

  • Create a new private key instance from a WIF-encoded string.

    Declaration

    Swift

    public init?(_ wif: String)

    Parameters

    wif

    The base58check-encoded string.

  • Create a new private key instance from a seed.

    Declaration

    Swift

    public init?(seed: String)

    Parameters

    seed

    String that is hashed and used as secret.

  • Sign a message.

    Declaration

    Swift

    public func sign(message: Data) throws -> Signature

    Parameters

    message

    The 32-byte message to sign.

  • Derive the public key for this private key.

    Declaration

    Swift

    public func createPublic(prefix: PublicKey.AddressPrefix = .mainNet) -> PublicKey

    Parameters

    prefix

    Address prefix to use when creating key, defaults to main net (STM).

  • The 33-byte private key where the first byte is the network id (0x80).

    Declaration

    Swift

    public var data: Data { get }
  • wif

    WIF-encoded string representation of private key.

    Declaration

    Swift

    public var wif: String { get }
  • Declaration

    Swift

    public var description: String { get }