-
Notifications
You must be signed in to change notification settings - Fork 0
/
io.randomseed.utils.crypto.html
7 lines (7 loc) · 13.3 KB
/
io.randomseed.utils.crypto.html
1
2
3
4
5
6
7
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>io.randomseed.utils.crypto documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script><link rel="stylesheet" type="text/css" href="css/randomseed.css" /></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Random:utils</span> <span class="project-version">1.2.34</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="10_introduction.html"><div class="inner"><span>Introduction</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>io</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>randomseed</span></div></div></li><li class="depth-3"><a href="io.randomseed.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.bot.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bot</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.bus.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bus</span></div></a></li><li class="depth-4 branch current"><a href="io.randomseed.utils.crypto.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>crypto</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-5"><a href="io.randomseed.utils.db.types.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>types</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.fs.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>fs</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.ip.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ip</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.log.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>log</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.map.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>map</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.nop-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>nop-cache</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>reitit</span></div></div></li><li class="depth-5"><a href="io.randomseed.utils.reitit.http.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>http</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.set.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>set</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.time.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>time</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.validators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validators</span></div></a></li><li class="depth-5"><a href="io.randomseed.utils.validators.common.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>common</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.var.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>var</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.vec.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>vec</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="io.randomseed.utils.crypto.html#var-ask-key"><div class="inner"><span>ask-key</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.crypto.html#var-ask-pass"><div class="inner"><span>ask-pass</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.crypto.html#var-decrypt-key"><div class="inner"><span>decrypt-key</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.crypto.html#var-decrypt-key-bin"><div class="inner"><span>decrypt-key-bin</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.crypto.html#var-decrypt-key-core"><div class="inner"><span>decrypt-key-core</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.crypto.html#var-encrypt-key"><div class="inner"><span>encrypt-key</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.crypto.html#var-key-.3Ebin"><div class="inner"><span>key->bin</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.crypto.html#var-pwd-.3Ebin"><div class="inner"><span>pwd->bin</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.crypto.html#var-read-key"><div class="inner"><span>read-key</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.crypto.html#var-read-pwd"><div class="inner"><span>read-pwd</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.crypto.html#var-salt-.3Ebin"><div class="inner"><span>salt->bin</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">io.randomseed.utils.crypto</h1><h4 class="added">added in 1.0.0</h4><div class="doc"><div class="markdown"><p>Random utilities, crypto support functions.</p>
</div></div><div class="public anchor" id="var-ask-key"><h3>ask-key</h3><div class="usage"><code>(ask-key & {:as opts})</code></div><div class="doc"><div class="markdown"><p>Ask user for a key with confirmation. Repeats until two keys are the same and are not empty. Keyword arguments can be given to configure behavior: <code>prompt</code> (message displayed when asking for first key), <code>confirm-prompt</code> (message displayed when asking for the same key again), <code>not-match-msg</code> (message displayed when keys do not match), <code>empty-msg</code> (message displayed when the entered key is empty), <code>retries</code> (number of retries before quitting the loop; when set to <code>nil</code> or not given, it will continue indefinitely), <code>confirmation?</code> (requires key to be re-entered for confirmation, defaults to <code>true</code>), <code>allow-empty?</code> (allows the entered key to be an empty string; defaults to <code>false</code>), <code>empty-nil?</code> (returns <code>nil</code> instead of an empty string when on empty key; defaults to <code>false</code>), <code>empty-quits?</code> (short-circuits on any empty key and returns <code>nil</code>; defaults to <code>false</code>), <code>empty-quits-nil?</code> (returns <code>nil</code> when quitting on empty key; defaults to <code>true</code>). Returns the entered key or <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/crypto.clj#L106">view source</a></div></div><div class="public anchor" id="var-ask-pass"><h3>ask-pass</h3><div class="usage"><code>(ask-pass & {:as opts})</code></div><div class="doc"><div class="markdown"><p>Ask user for a password with confirmation. Repeats until two passwords are the same and are not empty. Keyword arguments can be given to configure behavior: <code>prompt</code> (message displayed when asking for first password), <code>confirm-prompt</code> (message displayed when asking for the same password again), <code>not-match-msg</code> (message displayed when passwords do not match), <code>empty-msg</code> (message displayed when the entered password is empty), <code>retries</code> (number of retries before quitting the loop; when set to <code>nil</code> or not given, it will continue indefinitely), <code>confirmation?</code> (requires password to be re-entered for confirmation, defaults to <code>true</code>), <code>allow-empty?</code> (allows the entered password to be an empty string; defaults to <code>false</code>), <code>empty-nil?</code> (returns <code>nil</code> instead of an empty string when on empty password; defaults to <code>false</code>), <code>empty-quits?</code> (short-circuits on any empty password and returns <code>nil</code>; defaults to <code>false</code>), <code>empty-quits-nil?</code> (returns <code>nil</code> when quitting on empty password; defaults to <code>true</code>). Returns the entered password or <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/crypto.clj#L82">view source</a></div></div><div class="public anchor" id="var-decrypt-key"><h3>decrypt-key</h3><div class="usage"><code>(decrypt-key m password)</code><code>(decrypt-key encrypted salt password)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/crypto.clj#L61">view source</a></div></div><div class="public anchor" id="var-decrypt-key-bin"><h3>decrypt-key-bin</h3><div class="usage"><code>(decrypt-key-bin [iv-bin encrypted-bin] pwd-bin)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/crypto.clj#L57">view source</a></div></div><div class="public anchor" id="var-decrypt-key-core"><h3>decrypt-key-core</h3><div class="usage"><code>(decrypt-key-core encrypted k iv)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/crypto.clj#L49">view source</a></div></div><div class="public anchor" id="var-encrypt-key"><h3>encrypt-key</h3><div class="usage"><code>(encrypt-key k password)</code></div><div class="doc"><div class="markdown"><p>Encrypts private key using random IV and the given password. Returns base64-encoded map of two keys.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/crypto.clj#L37">view source</a></div></div><div class="public anchor" id="var-key-.3Ebin"><h3>key->bin</h3><div class="usage"><code>(key->bin v)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/crypto.clj#L29">view source</a></div></div><div class="public anchor" id="var-pwd-.3Ebin"><h3>pwd->bin</h3><div class="usage"><code>(pwd->bin v)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/crypto.clj#L33">view source</a></div></div><div class="public anchor" id="var-read-key"><h3>read-key</h3><div class="usage"><code>(read-key)</code><code>(read-key prompt)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/crypto.clj#L75">view source</a></div></div><div class="public anchor" id="var-read-pwd"><h3>read-pwd</h3><div class="usage"><code>(read-pwd)</code><code>(read-pwd prompt)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/crypto.clj#L68">view source</a></div></div><div class="public anchor" id="var-salt-.3Ebin"><h3>salt->bin</h3><div class="usage"><code>(salt->bin v)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/crypto.clj#L25">view source</a></div></div></div></body></html>