cometa-0.1.0.0: Idiomatic Haskell bindings to cardano-c
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cometa.Message.Cip8

Description

CIP-8 message signing with an address or key-hash binding. Payloads are nonempty raw bytes, signed directly with hashed = false and empty external AAD. Detached payloads, prehashing and custom AAD are not supported by this API.

Signing records the supplied binding; it does not prove the key controls that address or matches that hash. Applications and verifiers must check that link. The result owns immutable public bytes and remains usable after the key closes.

Synopsis

Documentation

data Binding Source #

A validated address or 28-byte key hash to include in the protected headers. This value does not establish a relationship with a signing key.

Instances

Instances details
Show Binding Source # 
Instance details

Defined in Cometa.Internal.Message.Cip8

Eq Binding Source # 
Instance details

Defined in Cometa.Internal.Message.Cip8

Methods

(==) :: Binding -> Binding -> Bool #

(/=) :: Binding -> Binding -> Bool #

addressBinding :: Address -> Binding Source #

Bind the signed headers to the complete validated address bytes.

keyHashBinding :: KeyHash purpose -> Binding Source #

Bind the signed headers to a validated key hash of any credential role.

data SignedMessage Source #

Two independently owned CBOR encodings, without hexadecimal conversion. The signature includes the payload and the COSE key includes its public key.

Constructors

SignedMessage 

Fields

Instances

Instances details
Show SignedMessage Source # 
Instance details

Defined in Cometa.Internal.Message.Cip8

Eq SignedMessage Source # 
Instance details

Defined in Cometa.Internal.Message.Cip8

sign :: SigningKey -> Binding -> ByteString -> IO (Either Error SignedMessage) Source #

Sign a nonempty binary payload using a live normal or extended key. Empty input returns native InvalidArgument; a closed key returns SigningKeyClosed. The result can outlive the key's scope.