Sign

org.sigilaris.core.crypto.Sign
See theSign companion object
trait Sign[A]

Type class for ECDSA signing operations.

Provides a type-safe interface for signing values of type A. The signing process first hashes the value using Hash, then signs the hash with ECDSA using the provided key pair.

Type parameters

A

the type of value to sign

Attributes

See also

Hash for hashing values

Signature for the signature representation

CryptoOps.sign for the underlying signing operation

Example
 import Sign.ops.*
 val keyPair = CryptoOps.generate()
 val message = Utf8("hello")
 // Sign a message
 val signature: Either[SigilarisFailure, Signature] =
   keyPair.sign(message)
 // Sign a pre-computed hash
 val hash = message.toHash
 val sig2 = hash.signBy(keyPair)
Companion
object
Source
Sign.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def byHash(hashValue: Value[A], keyPair: KeyPair): Either[SigilarisFailure, Signature]

Signs a pre-computed hash value.

Signs a pre-computed hash value.

Value parameters

hashValue

hash value to sign

keyPair

key pair to sign with

Attributes

Returns

Right(Signature) on success, Left(failure) on error

Source
Sign.scala

Concrete methods

def apply(a: A, keyPair: KeyPair)(using hash: Hash[A]): Either[SigilarisFailure, Signature]

Signs a value after hashing it.

Signs a value after hashing it.

Value parameters

a

value to sign

hash

implicit Hash instance for type A

keyPair

key pair to sign with

Attributes

Returns

Right(Signature) on success, Left(failure) on error

Source
Sign.scala