Module
Crypt.NaCl.Box
- Package
- purescript-crypt-nacl
- Repository
- throughnothing/purescript-crypt-nacl
#generateBoxKeyPair Source
generateBoxKeyPair :: forall e. Eff (naclRandom :: NACL_RANDOM | e) BoxKeyPairGenerate a BoxKeyPair for NaCl Box operations
#getBoxKeyPair Source
getBoxKeyPair :: BoxSecretKey -> BoxKeyPairGet a BoxKeyPair from the given BoxSecretKey
#getBoxPublicKey Source
getBoxPublicKey :: BoxKeyPair -> BoxPublicKeyGet a BoxPublicKey from the given BoxKeyPair
#getBoxSecretKey Source
getBoxSecretKey :: BoxKeyPair -> BoxSecretKeyGet a BoxSecretKey from the given BoxKeyPair
#box Source
box :: Message -> Nonce -> BoxPublicKey -> BoxSecretKey -> BoxCreate a Box, which is an encrypted, authenticated message
#boxBefore Source
boxBefore :: BoxPublicKey -> BoxSecretKey -> BoxSharedKeyCreate a BoxSharedKey from one user's BoxPublicKey and a separate
user's BoxSecretKey
#boxOpen Source
boxOpen :: Box -> Nonce -> BoxPublicKey -> BoxSecretKey -> Maybe MessageOpening a box decrypts and authenticates the message.
This will return the Message plaintext if decryption and SignatureB64
validation succeeds, and Nothing if authentication or decryption fails.
#boxOpenAfter Source
boxOpenAfter :: Box -> Nonce -> BoxSharedKey -> Maybe MessageSimilar to boxOpen, but opens a box with a BoxSharedKey that has been
generated with boxBefore instead of a BoxPublicKey and BoxSecretKey