| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Crypto.Age.Key
Description
age cryptographic keys.
Synopsis
- data FileKey where
- pattern FileKey :: ScrubbedBytes -> FileKey
- bytesToFileKey :: ScrubbedBytes -> Maybe FileKey
- fileKeyToBytes :: FileKey -> ScrubbedBytes
- generateFileKey :: IO FileKey
- data PayloadKeyNonce where
- pattern PayloadKeyNonce :: ByteString -> PayloadKeyNonce
- bytesToPayloadKeyNonce :: ByteString -> Maybe PayloadKeyNonce
- payloadKeyNonceToBytes :: PayloadKeyNonce -> ByteString
- generatePayloadKeyNonce :: IO PayloadKeyNonce
- payloadKeyNonceBuilder :: PayloadKeyNonce -> Builder
- payloadKeyNonceParser :: Parser PayloadKeyNonce
- data PayloadKey where
- pattern PayloadKey :: ScrubbedBytes -> PayloadKey
- bytesToPayloadKey :: ScrubbedBytes -> Maybe PayloadKey
- payloadKeyToBytes :: PayloadKey -> ScrubbedBytes
- mkPayloadKey :: PayloadKeyNonce -> FileKey -> PayloadKey
File key
Bundled Patterns
| pattern FileKey :: ScrubbedBytes -> FileKey |
fileKeyToBytes :: FileKey -> ScrubbedBytes Source #
Get the raw bytes associated with a FileKey.
generateFileKey :: IO FileKey Source #
Randomly generate a FileKey as defined in the
age specification.
Payload key nonce
data PayloadKeyNonce where Source #
Payload key nonce.
In accordance with the
age specification,
this value is used as an extractor salt in the HKDF-Extract step when
deriving a PayloadKey with HKDF-SHA256.
Bundled Patterns
| pattern PayloadKeyNonce :: ByteString -> PayloadKeyNonce |
Instances
| Show PayloadKeyNonce Source # | |
Defined in Crypto.Age.Key Methods showsPrec :: Int -> PayloadKeyNonce -> ShowS # show :: PayloadKeyNonce -> String # showList :: [PayloadKeyNonce] -> ShowS # | |
| Eq PayloadKeyNonce Source # | |
Defined in Crypto.Age.Key Methods (==) :: PayloadKeyNonce -> PayloadKeyNonce -> Bool # (/=) :: PayloadKeyNonce -> PayloadKeyNonce -> Bool # | |
bytesToPayloadKeyNonce :: ByteString -> Maybe PayloadKeyNonce Source #
Construct a PayloadKeyNonce from bytes.
If the provided byte string does not have a length of 16 (128 bits),
Nothing is returned.
payloadKeyNonceToBytes :: PayloadKeyNonce -> ByteString Source #
Get the raw bytes associated with a PayloadKeyNonce.
generatePayloadKeyNonce :: IO PayloadKeyNonce Source #
Randomly generate a PayloadKeyNonce as defined in the
age specification.
payloadKeyNonceBuilder :: PayloadKeyNonce -> Builder Source #
PayloadKeyNonce encoder.
Payload key
data PayloadKey where Source #
Symmetric payload key.
Note that this type's Eq instance performs a constant-time equality check.
Bundled Patterns
| pattern PayloadKey :: ScrubbedBytes -> PayloadKey |
Instances
| Eq PayloadKey Source # | |
Defined in Crypto.Age.Key | |
bytesToPayloadKey :: ScrubbedBytes -> Maybe PayloadKey Source #
Construct a PayloadKey from bytes.
If the provided byte string does not have a length of 32 (256 bits),
Nothing is returned.
payloadKeyToBytes :: PayloadKey -> ScrubbedBytes Source #
Get the raw bytes associated with a PayloadKey.
mkPayloadKey :: PayloadKeyNonce -> FileKey -> PayloadKey Source #
Construct a PayloadKey as defined in the
age specification.
The PayloadKey is derived via HKDF-SHA256 given a PayloadKeyNonce as
the extractor salt, a FileKey as the input keying material, and the string
payload as the expansion context/info.