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 #
toSha256 :: a -> Sha256 Source #
Instances
Signable Bool Source # | |
Signable Double Source # | |
Signable Float Source # | |
Signable Int32 Source # | |
Signable Int64 Source # | |
Signable Word32 Source # | |
Signable Word64 Source # | |
Signable ByteString Source # | |
Defined in Data.Signable.Class toBinary :: ByteString -> ByteString Source # toSha256 :: ByteString -> Sha256 Source # | |
Signable ByteString Source # | |
Defined in Data.Signable.Class toBinary :: ByteString -> ByteString0 Source # toSha256 :: ByteString -> Sha256 Source # | |
Signable Text Source # | |
(Foldable f, Signable a) => Signable (f a) Source # | |
data ECPointFormat Source #
Instances
Eq ECPointFormat Source # | |
Defined in Data.Signable.Class (==) :: ECPointFormat -> ECPointFormat -> Bool # (/=) :: ECPointFormat -> ECPointFormat -> Bool # | |
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
Show SignableError Source # | |
Defined in Data.Signable.Class showsPrec :: Int -> SignableError -> ShowS # show :: SignableError -> String # showList :: [SignableError] -> ShowS # |
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 #