31 Cryptography
(require denxi/crypto) | package: denxi |
denxi/crypto interacts with a bundled derivative of an OpenSSL library. This module has no side-effects on instantiation, but will mutate either a FFI object in the Racket runtime, or an error code cache in the C runtime. To reset the Racket runtime cache, call crypto-clear-ffi-cache!. To dump the error code cache, call crypto-dump-error-queue!.
procedure
procedure
(crypto-get-lib!) → (or/c ffi-lib? exn?)
The value returned from this function is cached in Racket-managed memory. If the cached value is an exception, then (get-crypto-lib!) will attempt to load the library again. This will replace the cached exception.
procedure
(crypto-get-obj! objname type) → any/c
objname : (or/c bytes? symbol? string?) type : ctype?
Returns #f if the cryptography library is cached as an exception, or if objname was not found in the library.
The value returned from this function is cached in Racket-managed memory.
procedure
(crypto-dump-error-queue!) → (or/c #f list?)
If the cryptography library is currently cached as an exception, this function will always return #f.
procedure
(crypto-translate-error! code) → (or/c #f string?)
code : exact-integer?
This function operates independently from denxi/l10n. If the output string does not respect the user’s locale, then supply translations to the correct denxi/l10n extention and use that extension instead.
procedure
(crypto-raise!) → any
Note that the side-effect implies movement of the entire error queue from the C runtime into the raised Racket value. Leverage this when you have reason to expect that the queue contains only the errors that pertain to a failed operation.
struct
(struct $crypto:error $crypto (queue))
queue : (listof exact-integer?)