Key material derived from a signed licence, and AES-GCM sealing under it.
Contract: the derived key depends on the signature, which cannot be produced
without the private key. A caller that needs unseal to obtain a value it
depends on therefore cannot be satisfied by deleting the licence check.
Key material derived from a signed licence, and AES-GCM sealing under it. Contract: the derived key depends on the signature, which cannot be produced without the private key. A caller that needs `unseal` to obtain a value it depends on therefore cannot be satisfied by deleting the licence check.
(derive-key signed purpose)32 key bytes for purpose, bound to signed's signature and payload.
32 key bytes for `purpose`, bound to `signed`'s signature and payload.
(seal signed purpose plaintext)Base64 of (IV ‖ AES-GCM ciphertext) of plaintext under the key derived for
purpose. Deterministic: the IV is derived from the key, purpose and
plaintext, so sealing is reproducible and two distinct plaintexts never share
an IV under one licence.
Base64 of (IV ‖ AES-GCM ciphertext) of `plaintext` under the key derived for `purpose`. Deterministic: the IV is derived from the key, purpose and plaintext, so sealing is reproducible and two distinct plaintexts never share an IV under one licence.
(unseal signed purpose ciphertext)Plaintext of base64 ciphertext (IV ‖ AES-GCM ciphertext), or nil when the
licence does not derive the key it was sealed under, the bytes were altered,
or the input is malformed.
Plaintext of base64 `ciphertext` (IV ‖ AES-GCM ciphertext), or nil when the licence does not derive the key it was sealed under, the bytes were altered, or the input is malformed.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |