Safe Haskell | None |
---|---|
Language | Haskell2010 |
Nats.Nkeys.Pairs
Synopsis
- data KeyPair = KeyPair {}
- publicKey :: KeyPair -> ByteString
- seed :: KeyPair -> ByteString
- createFromSeed :: ByteString -> Maybe KeyPair
- create :: KeyPrefix -> IO KeyPair
- sign :: KeyPair -> ByteString -> Maybe Signature
- verify :: KeyPair -> ByteString -> Signature -> Bool
Documentation
Represents an ed25519 key pair with NATS string encoding
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