Initializer
init(derRepresentation:)
Creates a secp256k1 public key for signing from a Distinguished Encoding Rules (DER) encoded representation.
- iOS 13.0+
- macCatalyst 13.0+
- macOS 10.15+
- tvOS 13.0+
- visionOS 1.0+
- watchOS 6.0+
init<Bytes>(derRepresentation: Bytes) throws where Bytes : RandomAccessCollection, Bytes.Element == UInt8
Parameters
-
derRepresentation
-
A DER-encoded representation of the key.
Discussion
Throws
CryptoKitASN1Error if derRepresentation is not a valid SubjectPublicKeyInfo DER encoding; CryptoKitError.incorrectParameterSize if the embedded key is neither 33 nor 65 bytes; secp256k1Error.underlyingCryptoError if secp256k1_ec_pubkey_parse rejects the bytes.