| Copyright | © Clément Delafargue 2021 |
|---|---|
| License | BSD-3-Clause |
| Maintainer | clement@delafargue.name |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Auth.Biscuit.Crypto
Description
Cryptographic helpers for biscuit signatures
Synopsis
- type SignedBlock = (ByteString, Signature, PublicKey, Maybe (Signature, PublicKey), Maybe Int)
- type Blocks = NonEmpty SignedBlock
- signAuthority :: SecretKey -> (ByteString, Int) -> IO (SignedBlock, SecretKey)
- signAttenuationBlock :: SecretKey -> Signature -> (ByteString, Int) -> Maybe (Signature, PublicKey) -> IO (SignedBlock, SecretKey)
- signExternalBlock :: SecretKey -> Signature -> (ByteString, Int) -> SecretKey -> IO (SignedBlock, SecretKey)
- sign3rdPartyBlockV1 :: SecretKey -> Signature -> ByteString -> (Signature, PublicKey)
- verifyBlocks :: Blocks -> PublicKey -> Bool
- verifySecretProof :: SecretKey -> SignedBlock -> Bool
- verifySignatureProof :: Signature -> SignedBlock -> Bool
- getSignatureProof :: SignedBlock -> SecretKey -> Signature
- verifyExternalSigV1 :: Signature -> (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), Maybe Int) Source #
type Blocks = NonEmpty SignedBlock Source #
signAuthority :: SecretKey -> (ByteString, Int) -> IO (SignedBlock, SecretKey) Source #
signAttenuationBlock :: SecretKey -> Signature -> (ByteString, Int) -> Maybe (Signature, PublicKey) -> IO (SignedBlock, SecretKey) Source #
signExternalBlock :: SecretKey -> Signature -> (ByteString, Int) -> SecretKey -> IO (SignedBlock, SecretKey) Source #
sign3rdPartyBlockV1 :: SecretKey -> Signature -> ByteString -> (Signature, PublicKey) Source #
verifySecretProof :: SecretKey -> SignedBlock -> Bool Source #
verifySignatureProof :: Signature -> SignedBlock -> Bool Source #
getSignatureProof :: SignedBlock -> SecretKey -> Signature Source #
verifyExternalSigV1 :: Signature -> (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)
Instances
| Show PublicKey Source # | |
| Eq PublicKey Source # | |
| Ord PublicKey Source # | |
| Lift PublicKey Source # | |
pkBytes :: PublicKey -> ByteString Source #
skBytes :: SecretKey -> ByteString Source #
sigBytes :: Signature -> ByteString Source #
signature :: ByteString -> Signature Source #