PublicKey

public struct PublicKey : Codable
extension PublicKey: CustomStringConvertible
extension PublicKey: Equatable

A struct representing a PublicKey

Properties

  • The raw bytes of the public key

    Declaration

    Swift

    public var bytes: [UInt8]
  • The signing curve used by the public key, to generate a wallet address

    Declaration

    Swift

    public let signingCurve: EllipticalCurve
  • Return a Base58 encoded version of the publicKey

    Declaration

    Swift

    public var base58CheckRepresentation: String { get }
  • Return a hash of the publicKey with the appropriate address prefix

    Declaration

    Swift

    public var publicKeyHash: String? { get }

Init

Utils

  • Verify that the given signature matches the given input bytes.

    Declaration

    Swift

    public func verify(message: [UInt8], signature: [UInt8]) -> Bool

    Parameters

    signature

    The proposed signature of the bytes.

    bytes

    The bytes to check.

    Return Value

    True if the public key and signature match the given bytes.

  • Take a base58Encoded public key (with a prefix) and convert it to a tzX public key hash

    Declaration

    Swift

    public static func publicKeyHash(fromBase58EncodedKey key: String) -> String?
  • Declaration

    Swift

    public var description: String { get }
  • Declaration

    Swift

    public static func == (lhs: PublicKey, rhs: PublicKey) -> Bool