gini-crypto-0.1.0.0

Safe HaskellNone
LanguageHaskell2010

Gini.Crypto.PubKey

Synopsis

Documentation

newtype PublicKey #

Constructors

PublicKey 

Fields

Instances
Eq PublicKey # 
Instance details

Defined in Gini.Crypto.PubKey

Show PublicKey # 
Instance details

Defined in Gini.Crypto.PubKey

NFData PublicKey # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

rnf :: PublicKey -> () #

ByteArrayAccess PublicKey # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

length :: PublicKey -> Int #

withByteArray :: PublicKey -> (Ptr p -> IO a) -> IO a #

copyByteArrayToPtr :: PublicKey -> Ptr p -> IO () #

Display PublicKey # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

display :: PublicKey -> Utf8Builder

textDisplay :: PublicKey -> Text

Persist PublicKey # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

put :: PublicKey -> Put ()

get :: Get PublicKey

Validity PublicKey # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

validate :: PublicKey -> Validation

PersistField PublicKey # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

toPersistValue :: PublicKey -> PersistValue

fromPersistValue :: PersistValue -> Either Text PublicKey

PersistFieldSql PublicKey # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

sqlType :: Proxy PublicKey -> SqlType

buildPublicKey #

Arguments

:: ByteArrayAccess ba 
=> String

Alternate name for the public key type for the error message

-> ba 
-> Either String PublicKey 

Create PublicKey from a sequence of bytes

mkPublicKeyHexQ :: String -> Q Exp #

Construct a PublicKey from a Base16 encoded string at compile time.

toCheckedPublicKey :: ByteArrayAccess ba => ba -> Either String PublicKey #

Supply an array containing concatenation of public key together with its checksum

newtype SecretKey #

Constructors

SecretKey 

Fields

Instances
Eq SecretKey # 
Instance details

Defined in Gini.Crypto.PubKey

Show SecretKey #

This instance will use show from Cryptonite, rather than hex

Instance details

Defined in Gini.Crypto.PubKey

NFData SecretKey # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

rnf :: SecretKey -> () #

ByteArrayAccess SecretKey # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

length :: SecretKey -> Int #

withByteArray :: SecretKey -> (Ptr p -> IO a) -> IO a #

copyByteArrayToPtr :: SecretKey -> Ptr p -> IO () #

Display SecretKey # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

display :: SecretKey -> Utf8Builder

textDisplay :: SecretKey -> Text

Persist SecretKey # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

put :: SecretKey -> Put ()

get :: Get SecretKey

Validity SecretKey # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

validate :: SecretKey -> Validation

buildSecretKey #

Arguments

:: ByteArrayAccess ba 
=> String

Alternate name for the secret key type for the error message

-> ba 
-> Either String SecretKey 

Create SecretKey from a sequence of bytes

generateSecretKey :: MonadRandom m => m SecretKey #

Create a random SecretKey (use with runRandom)

newtype Signature #

Constructors

Signature 

Fields

Instances
Eq Signature # 
Instance details

Defined in Gini.Crypto.PubKey

Show Signature # 
Instance details

Defined in Gini.Crypto.PubKey

NFData Signature # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

rnf :: Signature -> () #

ByteArrayAccess Signature # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

length :: Signature -> Int #

withByteArray :: Signature -> (Ptr p -> IO a) -> IO a #

copyByteArrayToPtr :: Signature -> Ptr p -> IO () #

Display Signature # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

display :: Signature -> Utf8Builder

textDisplay :: Signature -> Text

Persist Signature # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

put :: Signature -> Put ()

get :: Get Signature

Validity Signature # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

validate :: Signature -> Validation

PersistField Signature # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

toPersistValue :: Signature -> PersistValue

fromPersistValue :: PersistValue -> Either Text Signature

PersistFieldSql Signature # 
Instance details

Defined in Gini.Crypto.PubKey

Methods

sqlType :: Proxy Signature -> SqlType

buildSignature :: ByteArrayAccess ba => ba -> Either String Signature #

Create Signature from a sequence of bytes

sign :: ByteArrayAccess ba => SecretKey -> PublicKey -> ba -> Signature #

Sign the message with Ed25519 SecretKey and PublicKey pair

verify :: ByteArrayAccess ba => PublicKey -> ba -> Signature -> Bool #

Verify the signature of a message with Ed25519 PublicKey