Initializer
init(dataRepresentation:format:)
Creates a secp256k1 public key from serialized bytes.
- iOS 13.0+
- macCatalyst 13.0+
- macOS 10.15+
- tvOS 13.0+
- visionOS 1.0+
- watchOS 6.0+
init<D>(dataRepresentation data: D, format: P256K.Format) throws where D : ContiguousBytes
Parameters
-
data
-
Serialized public key bytes whose length must match format.length.
-
format
-
The serialization format of data (.compressed for 33 bytes, .uncompressed for 65 bytes).
Discussion
Throws
secp256k1Error.underlyingCryptoError if parsing via secp256k1_ec_pubkey_parse fails.