Safe Haskell | None |
---|---|
Language | Haskell2010 |
Digital signature is common security-related practice.
One of the main difficulties of digital signature usage
is necessity of determenistic data serialization agreement.
This library provides Signable
class which represents
the idea of such agreement. Also worth mentioning generic
proto-lens compatible implementation
of serialization/signing algorithm described here.
It's implemented as separate protoc plugin signable-haskell-protoc
which generates Signable
class instances for given proto-lens messages and enums.
Documentation
ifThenElse :: (a -> Bool) -> (a -> b) -> (a -> b) -> a -> b Source #
class Signable a where Source #
toBinary :: a -> ByteString Source #
Instances
data ECPointFormat Source #
Instances
Eq ECPointFormat Source # | |
Defined in Data.Signable.Class (==) :: ECPointFormat -> ECPointFormat -> Bool # (/=) :: ECPointFormat -> ECPointFormat -> Bool # | |
Ord ECPointFormat Source # | |
Defined in Data.Signable.Class compare :: ECPointFormat -> ECPointFormat -> Ordering # (<) :: ECPointFormat -> ECPointFormat -> Bool # (<=) :: ECPointFormat -> ECPointFormat -> Bool # (>) :: ECPointFormat -> ECPointFormat -> Bool # (>=) :: ECPointFormat -> ECPointFormat -> Bool # max :: ECPointFormat -> ECPointFormat -> ECPointFormat # min :: ECPointFormat -> ECPointFormat -> ECPointFormat # | |
Show ECPointFormat Source # | |
Defined in Data.Signable.Class showsPrec :: Int -> ECPointFormat -> ShowS # show :: ECPointFormat -> String # showList :: [ECPointFormat] -> ShowS # |
data SignableError Source #
InvalidPem | |
TooFewPemChunks | |
TooManyPemChunks | |
InvalidAsn1 | |
TooFewAsn1Chunks | |
TooManyAsn1Chunks | |
InvalidPubKeyDer | |
InvalidPrvKeyRaw |
Instances
Eq SignableError Source # | |
Defined in Data.Signable.Class (==) :: SignableError -> SignableError -> Bool # (/=) :: SignableError -> SignableError -> Bool # | |
Ord SignableError Source # | |
Defined in Data.Signable.Class compare :: SignableError -> SignableError -> Ordering # (<) :: SignableError -> SignableError -> Bool # (<=) :: SignableError -> SignableError -> Bool # (>) :: SignableError -> SignableError -> Bool # (>=) :: SignableError -> SignableError -> Bool # max :: SignableError -> SignableError -> SignableError # min :: SignableError -> SignableError -> SignableError # | |
Show SignableError Source # | |
Defined in Data.Signable.Class showsPrec :: Int -> SignableError -> ShowS # show :: SignableError -> String # showList :: [SignableError] -> ShowS # |
pubKey2Alg :: PubKey -> Alg Source #
prvKey2Alg :: PrvKey -> Alg Source #
importPubKeyDer :: Alg -> ByteString -> Maybe PubKey Source #
importPubKeyPem :: Alg -> ByteString -> Either SignableError PubKey Source #
exportPubKeyDer :: ECPointFormat -> PubKey -> ByteString Source #
derivePubKey :: PrvKey -> PubKey Source #
importPrvKeyRaw :: Alg -> ByteString -> Maybe PrvKey Source #
importPrvKeyPem :: Alg -> ByteString -> Either SignableError PrvKey Source #
exportPrvKeyRaw :: PrvKey -> ByteString Source #
importSigDer :: Alg -> ByteString -> Maybe Sig Source #
exportSigDer :: Sig -> ByteString Source #