sel-0.0.1.0: Cryptography for the casual user
Copyright(C) Hécate Moonlight 2022
LicenseBSD-3-Clause
MaintainerThe Haskell Cryptography Group
PortabilityGHC only
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sel.PublicKey.Signature

Description

 
Synopsis

Introduction

Public-key Signatures work with a SecretKey and PublicKey

  • The SecretKey is used to append a signature to any number of messages. It must stay private;
  • The PublicKey is used by third-parties to to verify that the signature appended to a message was issued by the creator of the public key. It must be distributed to third-parties.

Verifiers need to already know and ultimately trust a public key before messages signed using it can be verified.

data PublicKey Source #

Since: 0.0.1.0

Instances

Instances details
Eq PublicKey Source #

Since: 0.0.1.0

Instance details

Defined in Sel.PublicKey.Signature

Ord PublicKey Source #

Since: 0.0.1.0

Instance details

Defined in Sel.PublicKey.Signature

data SecretKey Source #

Since: 0.0.1.0

Instances

Instances details
Eq SecretKey Source #

Since: 0.0.1.0

Instance details

Defined in Sel.PublicKey.Signature

Ord SecretKey Source #

Since: 0.0.1.0

Instance details

Defined in Sel.PublicKey.Signature

Key Pair generation

generateKeyPair :: IO (PublicKey, SecretKey) Source #

Generate a pair of public and secret key.

The length parameters used are cryptoSignPublicKeyBytes and cryptoSignSecretKeyBytes.

Since: 0.0.1.0

Message Signing

signMessage :: StrictByteString -> SecretKey -> IO SignedMessage Source #

Sign a message.

Since: 0.0.1.0

openMessage :: SignedMessage -> PublicKey -> Maybe StrictByteString Source #

Open a signed message with the signatory's public key. The function returns Nothing if there is a key mismatch.

Since: 0.0.1.0

Constructing and Deconstructing

getSignature :: SignedMessage -> StrictByteString Source #

Get the signature part of a SignedMessage.

Since: 0.0.1.0

unsafeGetMessage :: SignedMessage -> StrictByteString Source #

Get the message part of a SignedMessage without verifying the signature.

Since: 0.0.1.0

mkSignature :: StrictByteString -> StrictByteString -> SignedMessage Source #

Combine a message and a signature into a SignedMessage.

Since: 0.0.1.0