KeyPair
public struct KeyPairA struct representing a both a PrivateKey and PublicKey with helper methods to create various kinds
- 
                  
                  The underlying PrivateKeyof the pairDeclarationSwift public let privateKey: PrivateKey
- 
                  
                  Create a regular (non HD) KeyPairfrom a hex seed stringDeclarationSwift public static func regular(fromSeedString seedString: String) -> KeyPair?ParametersseedStringA hex string representing a cryptographic seed (can be created from Mnemonic)Return ValueA KeyPairinstance, if able, nil otherwise
- 
                  
                  Create a KeyPairfrom a Base58 Check encoded secret key, optionaly encrypted with a passphrase. Supports both Tz1 (edsk… edes…) and Tz2 (spsk… spes…)DeclarationSwift public static func regular(fromSecretKey secretKey: String, andPassphrase: String?) -> KeyPair?
- 
                  
                  Create a HD KeyPairfrom a hex seed string and optional Derivation Path (defaults to m/44’/1729’/0’/0’ ). Only TZ1 are produceableDeclarationSwift public static func hd(fromSeedString seedString: String, andDerivationPath derivationPath: String = HD.defaultDerivationPath) -> KeyPair?ParametersseedStringA hex string representing a cryptographic seed (can be created from Mnemonic)derivationPathThe derivationPath to use Return ValueA KeyPairinstance, if able, nil otherwise
- 
                  
                  Helper method to take a secp256k1 private key (for a regualr keypair) and use it to create a public key for the same curve DeclarationSwift public static func secp256k1PublicKey(fromPrivateKeyBytes pkBytes: [UInt8]) -> PublicKey?
- 
                  
                  Helper method to uncompress a secp256k1 public key DeclarationSwift public static func secp256k1PublicKey_uncompressed(fromBytes: [UInt8]) -> [UInt8]
- 
                  
                  DeclarationSwift public static func decryptSecretKey(_ secretKey: String, ellipticalCurve: EllipticalCurve, passphrase: String) -> KeyPair?
- 
                  
                  DeclarationSwift public static func pbkdf2(password: String, saltData: Data, keyByteCount: Int, prf: CCPseudoRandomAlgorithm, rounds: Int) -> Data?
- 
                  
                  DeclarationSwift public static func isSecretKeyEncrypted(_ secret: String) -> Bool
 Install in Dash
Install in Dash