-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathPlug.MessageVerifier.html
136 lines (90 loc) · 4.1 KB
/
Plug.MessageVerifier.html
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<html>
<head>
<title>Plug.MessageVerifier</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
relpath = '';
if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
</head>
<body>
<script type="text/javascript" charset="utf-8">
if (window.top.frames.main) document.body.className = 'frames';
</script>
<div id="content">
<div class="breadcrumbs">plug v0.5.1 → <a href="overview.html">Overview</a> → <a href="Plug.html">Plug</a> → <a href="Plug.MessageVerifier.html">MessageVerifier</a></div>
<h1>
Plug.MessageVerifier
</h1>
<ul class="summary_links">
<li><a href="#summary">Summary</a></li>
<li><a href="#functions_details">Functions</a></li>
</ul>
<div id="moduledoc" class="docstring">
<p><code>MessageVerifier</code> makes it easy to generate and verify messages which are signed to prevent tampering.</p>
<p>For example, the cookie store uses this verifier to send data to the client. Although the data can be read by the client, he cannot tamper it.</p>
</div>
<h2 id="summary">Summary<div class="detail_header_links"><a class="to_top_link" href="#content" title="To the top of the page">↑</a></div></h2>
<table class="summary">
<tr>
<td class="summary_signature"><a href="#generate/2">generate(secret, term)</a></td>
<td class="summary_synopsis"><p>Generates an encoded and signed binary for the given term</p>
</td>
</tr>
<tr>
<td class="summary_signature"><a href="#secure_compare/2">secure_compare(left, right)</a></td>
<td class="summary_synopsis"><p>Compares the two binaries completely, byte by byte, to avoid timing attacks</p>
</td>
</tr>
<tr>
<td class="summary_signature"><a href="#verify/2">verify(secret, encoded)</a></td>
<td class="summary_synopsis"><p>Decodes and verifies the encoded binary was not tampared with</p>
</td>
</tr>
</table>
<div id="functions_details" class="details_list">
<h2>Functions</h2>
<div class="detail">
<div class="detail_header" id="generate/2">
<span class="signature"><strong>generate(secret, term)</strong></span>
<div class="detail_header_links">
<span class="detail_type">(function)</span>
<a href="#generate/2" class="detail_link" title="Link to this function">#</a>
<a class="to_top_link" href="#content" title="To the top of the page">↑</a>
</div>
</div>
<div class="docstring"><p>Generates an encoded and signed binary for the given term.</p>
</div>
</div>
<div class="detail">
<div class="detail_header" id="secure_compare/2">
<span class="signature"><strong>secure_compare(left, right)</strong></span>
<div class="detail_header_links">
<span class="detail_type">(function)</span>
<a href="#secure_compare/2" class="detail_link" title="Link to this function">#</a>
<a class="to_top_link" href="#content" title="To the top of the page">↑</a>
</div>
</div>
<div class="docstring"><p>Compares the two binaries completely, byte by byte, to avoid timing attacks.</p>
</div>
</div>
<div class="detail">
<div class="detail_header" id="verify/2">
<span class="signature"><strong>verify(secret, encoded)</strong></span>
<div class="detail_header_links">
<span class="detail_type">(function)</span>
<a href="#verify/2" class="detail_link" title="Link to this function">#</a>
<a class="to_top_link" href="#content" title="To the top of the page">↑</a>
</div>
</div>
<div class="docstring"><p>Decodes and verifies the encoded binary was not tampared with.</p>
</div>
</div>
</div>
</div>
</body>
</html>