Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type SignedBlock = (ByteString, Signature, PublicKey, Maybe (Signature, PublicKey))
- type Blocks = NonEmpty SignedBlock
- signBlock :: SecretKey -> ByteString -> Maybe (Signature, PublicKey) -> IO (SignedBlock, SecretKey)
- signExternalBlock :: SecretKey -> SecretKey -> PublicKey -> ByteString -> IO (SignedBlock, SecretKey)
- sign3rdPartyBlock :: SecretKey -> PublicKey -> ByteString -> (Signature, PublicKey)
- verifyBlocks :: Blocks -> PublicKey -> Bool
- verifySecretProof :: SecretKey -> SignedBlock -> Bool
- verifySignatureProof :: Signature -> SignedBlock -> Bool
- getSignatureProof :: SignedBlock -> SecretKey -> Signature
- verifyExternalSig :: PublicKey -> (ByteString, Signature, PublicKey) -> Bool
- data PublicKey
- pkBytes :: PublicKey -> ByteString
- readEd25519PublicKey :: ByteString -> Maybe PublicKey
- data SecretKey
- skBytes :: SecretKey -> ByteString
- readEd25519SecretKey :: ByteString -> Maybe SecretKey
- data Signature
- sigBytes :: Signature -> ByteString
- signature :: ByteString -> Signature
- generateSecretKey :: IO SecretKey
- toPublic :: SecretKey -> PublicKey
- sign :: SecretKey -> PublicKey -> ByteString -> Signature
Documentation
type SignedBlock = (ByteString, Signature, PublicKey, Maybe (Signature, PublicKey)) Source #
type Blocks = NonEmpty SignedBlock Source #
signBlock :: SecretKey -> ByteString -> Maybe (Signature, PublicKey) -> IO (SignedBlock, SecretKey) Source #
signExternalBlock :: SecretKey -> SecretKey -> PublicKey -> ByteString -> IO (SignedBlock, SecretKey) Source #
sign3rdPartyBlock :: SecretKey -> PublicKey -> ByteString -> (Signature, PublicKey) Source #
verifySecretProof :: SecretKey -> SignedBlock -> Bool Source #
verifySignatureProof :: Signature -> SignedBlock -> Bool Source #
getSignatureProof :: SignedBlock -> SecretKey -> Signature Source #
verifyExternalSig :: PublicKey -> (ByteString, Signature, PublicKey) -> Bool Source #
When adding a pre-signed third-party block to a token, we make sure the third-party block is correctly signed (pk-signature match, and the third-party block is pinned to the last biscuit block)
pkBytes :: PublicKey -> ByteString Source #
Instances
skBytes :: SecretKey -> ByteString Source #
Instances
sigBytes :: Signature -> ByteString Source #
signature :: ByteString -> Signature Source #