Initializer
init(format:)
Creates a random secp256k1 recoverable-signing private key by generating 32 cryptographically secure random bytes validated with secp256k1_ec_seckey_verify.
- iOS 13.0+
- macCatalyst 13.0+
- macOS 10.15+
- tvOS 13.0+
- visionOS 1.0+
- watchOS 6.0+
init(format: P256K.Format = .compressed) throws
Parameters
-
format
-
The serialization format of the companion publicKey; defaults to .compressed.
Discussion
Throws
secp256k1Error.underlyingCryptoError if the generated bytes are not a valid secp256k1 private key.