Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libhmac.tex @ 21467:4e35fa5d5708 legacy-trunk
Add documentation for the help() built-in; contributed by Ka-Ping Yee.
This is part of SF patch #494622.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Tue, 18 Dec 2001 16:31:08 +0000 |
| parents | af98282e9277 |
| children | 624918e1c1b2 |
| rev | line source |
|---|---|
|
19868
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1 \section{\module{hmac} --- |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
2 Keyed-Hashing for Message Authentication} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
3 |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
4 \declaremodule{standard}{hmac} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
5 \modulesynopsis{Keyed-Hashing for Message Authentication (HMAC) |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
6 implementation for Python.} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
7 \moduleauthor{Gerhard H{\"a}ring}{ghaering@users.sourceforge.net} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
8 \sectionauthor{Gerhard H{\"a}ring}{ghaering@users.sourceforge.net} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
9 |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
10 \versionadded{2.2} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
11 |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
12 This module implements the HMAC algorithm as described by \rfc{2104}. |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
13 |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
14 \begin{funcdesc}{new}{key\optional{, msg\optional{, digestmod}}} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
15 Return a new hmac object. If \var{msg} is present, the method call |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
16 \code{update(\var{msg})} is made. \var{digestmod} is the digest |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
17 module for the HMAC object to use. It defaults to the |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
18 \refmodule{md5} module. |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
19 \end{funcdesc} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
20 |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
21 An HMAC object has the following methods: |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
22 |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
23 \begin{methoddesc}[hmac]{update}{msg} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
24 Update the hmac object with the string \var{msg}. Repeated calls |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
25 are equivalent to a single call with the concatenation of all the |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
26 arguments: \code{m.update(a); m.update(b)} is equivalent to |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
27 \code{m.update(a + b)}. |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
28 \end{methoddesc} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
29 |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
30 \begin{methoddesc}[hmac]{digest}{} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
31 Return the digest of the strings passed to the \method{update()} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
32 method so far. This is a 16-byte string (for \refmodule{md5}) or a |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
33 20-byte string (for \refmodule{sha}) which may contain non-\ASCII{} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
34 characters, including NUL bytes. |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
35 \end{methoddesc} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
36 |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
37 \begin{methoddesc}[hmac]{hexdigest}{} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
38 Like \method{digest()} except the digest is returned as a string of |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
39 length 32 for \refmodule{md5} (40 for \refmodule{sha}), containing |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
40 only hexadecimal digits. This may be used to exchange the value |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
41 safely in email or other non-binary environments. |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
42 \end{methoddesc} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
43 |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
44 \begin{methoddesc}[hmac]{copy}{} |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
45 Return a copy (``clone'') of the hmac object. This can be used to |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
46 efficiently compute the digests of strings that share a common |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
47 initial substring. |
|
af98282e9277
Documentation for the new hmac module, contributed by Gerhard Häring.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
48 \end{methoddesc} |
