| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Network.AWS.CloudFront.SignedCookies.Crypto
- readPrivateKeyPemFile :: PemFilePath -> IO PrivateKey
- sign :: PrivateKey -> ByteString -> IO ByteString
- data PrivateKey :: *
- data ByteString :: *
Reading the private key
readPrivateKeyPemFile Source #
Arguments
| :: PemFilePath | The filesystem path of the |
| -> IO PrivateKey |
Read an RSA private key from a .pem file you downloaded from AWS.
Generating signatures
Arguments
| :: PrivateKey | The RSA private key that you read from the |
| -> ByteString | The JSON representation of the |
| -> IO ByteString |
Construct the signature that will go into the
CloudFront-Signature cookie.
Types
data PrivateKey :: * #
Represent a RSA private key.
Only the pub, d fields are mandatory to fill.
p, q, dP, dQ, qinv are by-product during RSA generation, but are useful to record here to speed up massively the decrypt and sign operation.
implementations can leave optional fields to 0.
Instances
data ByteString :: * #
A space-efficient representation of a Word8 vector, supporting many
efficient operations.
A ByteString contains 8-bit bytes, or by using the operations from
Data.ByteString.Char8 it can be interpreted as containing 8-bit
characters.