Instance Method
signature(for:)
Generates a recoverable ECDSA signature by SHA-256 hashing data then calling secp256k1_ecdsa_sign_recoverable.
- iOS 13.0+
- macCatalyst 13.0+
- macOS 10.15+
- tvOS 13.0+
- visionOS 1.0+
- watchOS 6.0+
func signature<D>(for data: D) -> P256K.Recovery.PrivateKey.Signature where D : DataProtocol
Parameters
-
data
-
The message to sign; hashed with SHA-256 before signing.
Return Value
A 65-byte P256K.Recovery.ECDSASignature from which the signer’s P256K.Recovery.PublicKey can be recovered.
Discussion
Note
The produced signature is re-parsed and key-recovered against this key’s publicKey before it is returned — a failure is unreachable after input validation, reports through setInvariantViolationHandler(_:), and terminates the process.