nkeys-0.0.1.1: Nkeys ed25519 encoding for use with NATS
Safe HaskellNone
LanguageHaskell2010

Nats.Nkeys.Pairs

Synopsis

Documentation

data KeyPair Source #

Represents an ed25519 key pair with NATS string encoding

Constructors

KeyPair 

Instances

Instances details
Show KeyPair Source # 
Instance details

Defined in Nats.Nkeys.Pairs

Eq KeyPair Source # 
Instance details

Defined in Nats.Nkeys.Pairs

Methods

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

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

publicKey :: KeyPair -> ByteString Source #

Returns the public key of the pair as a prefixed byte string

seed :: KeyPair -> ByteString Source #

Returns the seed (private) key of the pair as a prefixed string starting with S

createFromSeed :: ByteString -> Maybe KeyPair Source #

Creates a new keypair from an encoded seed with an appropriate prefix. Do not call this function with unencoded ed25519 seeds

create :: KeyPrefix -> IO KeyPair Source #

This IO action creates a new key pair from a randomly generated 32-byte seed

sign :: KeyPair -> ByteString -> Maybe Signature Source #

Signs the given input bytes using the key pair's seed key

verify :: KeyPair -> ByteString -> Signature -> Bool Source #

Verifies a signature against the key pair's public key and the input bytes