Swift wrapper for privmx.NativeCryptoApiWrapper.
This class provides cryptographic functions such as key generation, encryption, and decryption, as well as signing data. It wraps the underlying C++ implementation for use in Swift.
Generates a new Private Key, which can be used for accessing PrivMX Bridge.
This method generates a private key using an optional base string (seed) for added randomness. The generated key is returned in WIF (Wallet Import Format).
public func generatePrivateKey( withSeed randomSeed: String? ) throws -> String
Name
Type
Description
randomSeed
String?
An optional seed string to generate the private key. If `nil`, a random seed is used.
Deterministically derives a Private Key from a password and salt.
This method generates a private key using a combination of a password and salt. The resulting private key is derived in a deterministic way, ensuring the same password and salt will always produce the same private key.
public func derivePrivateKey( from password: String, and salt: String ) throws -> String
Name
Type
Description
password
String
The base string (password) used for private key generation.
salt
String
A string used as salt for private key generation.
Type
Description
String
The derived private key in WIF format (Wallet Import Format) as a `String`.