org.sigilaris.core.crypto.Recover
See theRecover companion object
Type class for recovering public keys from ECDSA signatures.
Provides a type-safe interface for recovering the public key that was used to create a signature. The recovery process first hashes the value using Hash, then uses the signature's recovery parameter to recover the public key.
Type parameters
- A
-
the type of value that was signed
Attributes
- See also
-
Sign for signature creation
Signature for the signature representation
CryptoOps.recover for the underlying recovery operation
- Example
-
import Recover.ops.* val keyPair = CryptoOps.generate() val message = Utf8("hello") val signature = keyPair.sign(message).toOption.get // Recover public key from signature val hash = message.toHash val recovered: Either[SigilarisFailure, PublicKey] = hash.recover(signature) assert(recovered.contains(keyPair.publicKey)) - Companion
- object
- Source
- Recover.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
In this article