| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
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
- data Binding
- addressBinding :: Address -> Binding
- keyHashBinding :: KeyHash purpose -> Binding
- data SignedMessage = SignedMessage {
- coseSign1 :: !ByteString
- coseKey :: !ByteString
- sign :: SigningKey -> Binding -> ByteString -> IO (Either Error SignedMessage)
Documentation
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.
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
| Show SignedMessage Source # | |
Defined in Cometa.Internal.Message.Cip8 Methods showsPrec :: Int -> SignedMessage -> ShowS # show :: SignedMessage -> String # showList :: [SignedMessage] -> ShowS # | |
| Eq SignedMessage Source # | |
Defined in Cometa.Internal.Message.Cip8 Methods (==) :: SignedMessage -> SignedMessage -> Bool # (/=) :: SignedMessage -> SignedMessage -> Bool # | |
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.