-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
81 lines (55 loc) · 4.07 KB
/
index.html
File metadata and controls
81 lines (55 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="description" content="Openpassword : " />
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
<title>Openpassword</title>
</head>
<body>
<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
<a id="forkme_banner" href="https://github.com/OpenPassword">View on GitHub</a>
<h1 id="project_title">Openpassword</h1>
<h2 id="project_tagline"></h2>
</header>
</div>
<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner">
<h3>
<a name="whats-openpassword" class="anchor" href="#whats-openpassword"><span class="octicon octicon-link"></span></a>What's OpenPassword?</h3>
<p>Openpassword is a python API to access an Agilekeychain.</p>
<h3>
<a name="can-i-see-some-api-examples" class="anchor" href="#can-i-see-some-api-examples"><span class="octicon octicon-link"></span></a>Can I see some API examples?</h3>
<p>Currently OpenPassword is in early development stage, and most of the API is yet to implement. Here are some examples of the few implemented bits:</p>
<h4>
<a name="unlocking-the-keychain" class="anchor" href="#unlocking-the-keychain"><span class="octicon octicon-link"></span></a>Unlocking the keychain</h4>
<div class="highlight highlight-python"><pre><span class="kn">from</span> <span class="nn">openpassword</span> <span class="kn">import</span> <span class="n">Keychain</span>
<span class="kn">from</span> <span class="nn">openpassword</span> <span class="kn">import</span> <span class="n">EncryptionKeyFactory</span>
<span class="n">keychain</span> <span class="o">=</span> <span class="n">Keychain</span><span class="p">(</span><span class="n">EncryptionKeyFactory</span><span class="p">(</span><span class="n">keys</span><span class="p">)</span><span class="o">.</span><span class="n">key_for_security_level</span><span class="p">(</span><span class="s">"SL5"</span><span class="p">))</span>
<span class="n">keychain</span><span class="o">.</span><span class="n">unlock</span><span class="p">()</span>
</pre></div>
<h4>
<a name="decrypting-an-encryption-key" class="anchor" href="#decrypting-an-encryption-key"><span class="octicon octicon-link"></span></a>Decrypting an encryption key</h4>
<div class="highlight highlight-python"><pre><span class="kn">from</span> <span class="nn">openpassword</span> <span class="kn">import</span> <span class="n">EncryptionKey</span>
<span class="n">encryption_key</span> <span class="o">=</span> <span class="n">EncryptionKeyFactory</span><span class="p">(</span><span class="n">keys</span><span class="p">)</span><span class="o">.</span><span class="n">key_for_security_level</span><span class="p">(</span><span class="s">"SL5"</span><span class="p">)</span>
<span class="n">decrypted_key</span> <span class="o">=</span> <span class="n">encryption_key</span><span class="o">.</span><span class="n">decrypt</span><span class="p">(</span><span class="s">'masterpassword123'</span><span class="p">)</span>
</pre></div>
<p>The <code>keys</code> parameter passed to the EncryptionKeyFactory is a dictionary similar to the one found in the <a href="https://github.com/OpenPassword/OpenPassword/blob/develop/spec/openpassword/encryption_key_factory_spec.py#L7">EncryptionKeyFactorySpec</a> file.</p>
<h3>
<a name="contributing" class="anchor" href="#contributing"><span class="octicon octicon-link"></span></a>Contributing</h3>
<p>First check the "<a href="/OpenPassword/OpenPassword/blob/develop/CONTRIBUTING.md#contributing">How to contribute</a>" page.</p>
<p>Then, <a href="https://github.com/OpenPassword/OpenPassword/fork">fork the repository</a>, create your feature and make a pull request.</p>
</section>
</div>
<!-- FOOTER -->
<div id="footer_wrap" class="outer">
<footer class="inner">
<p>Published with <a href="http://pages.github.com">GitHub Pages</a></p>
</footer>
</div>
</body>
</html>