RecoveryKeyUtils

public class RecoveryKeyUtils

A utility class with functions for handling recovery keys.

  • Generates a new private key that can be used to register for revocation and recovery.

    Declaration

    Swift

    public static func generateRecoveryKey() -> Data?

    Return Value

    a 32-byte data object or nil if it failed.

  • Derives the address from the recovery key data.

    Declaration

    Swift

    public static func calculateRecoveryKeyAddress(keyData: Data) -> String?

    Return Value

    The hex-encoded blockchain address for this recovery key.

  • Return a random word list.

    Declaration

    Swift

    public static func getRandomWordList() -> [String]

    Return Value

    Array of random words.

  • Derive a key from the given word list.

    Declaration

    Swift

    public static func deriveKeyFromWordList(wordList: [String], passphrase: String?) -> Data?

    Return Value

    the key derived from the word list, or nil if the checksum failed.

  • Set the claim backup key to use - parameter keyData: raw Data of the private key to use for backup

    Declaration

    Swift

    public static func setClaimBackupKey(keyData: Data)