source: project/wiki/eggref/3/crypt @ 13621

Last change on this file since 13621 was 13621, checked in by sjamaan, 11 years ago

Move old chicken 3 eggs over to eggref/3

File size: 7.5 KB
Line 
1[[tags: egg]]
2
3== crypt
4
5[[toc:]]
6
7=== Description
8
9Bindings to [[http://www.cs.auckland.ac.nz/~pgut001/cryptlib/|cryptlib]].
10
11=== Author
12
13[[Thomas Christian Chust]]
14
15=== Requirements
16
17None
18
19=== Download
20
21[[http://www.call-with-current-continuation.org/eggs/crypt.egg|crypt.egg]]
22
23=== Documentation
24
25cryptlib is a high level cryptography library written by Peter Gutmann.
26You can find information and downloads for it at
27[[http://www.cs.auckland.ac.nz/~pgut001/cryptlib]]
28
29At the time of writing of this code, the library is available
30under the same license conditions as this code.
31
32The bindings in this package provide the same functionality as the
33functions documented in the original cryptlib documentation, with the
34following exceptions:
35
36*  All constants named {{CRYPT_xxx_yyy}} are named {{CRYPT-xxx-yyy}} in Scheme code
37*  All functions named {{cryptXxxYyy}} are named {{crypt-xxx-yyy}} in Scheme code
38*  None of the bindings returns an error code. Usually the return value is {{(void)}}. In case of error, an exception of the composite kind {{(exn crypt)}} is signalled. It contains the parameters message (with a descriptive message of the error condition) and code (with the cryptlib error code)
39*  All {{crypt-create-xxx}} functions and other functions creating an object like {{crypt-import-cert}} take no output parameter for the created object but rather return the new object.
40*  All functions expecting a buffer of data and a size as input arguments (like {{crypt-set-attribute-string}}) can take a string or byte-vector as a single input argument in that place or any object and a size as two input arguments.
41*  {{crypt-pop-data}}, which expects a buffer and a maximum size as an output argument can take either a string or a byte-vector as a single output argument in that place or a maximum size as a single argument in that place or a maximum size and any object. They return the list (buffer bytes-read) where buffer (if it was not given) is a freshly allocated string of maximum size bytes.
42
43A list of all functions behaving slightly differently from the
44cryptlib documentation follows, sorted alphabetically:
45
46* {{crypt-async-query}} returns #t if an asynchronous operation is running, #f otherwise
47* {{crypt-ca-cert-management}} gets one parameter less than the normal cryptlib function call, but an additional optional parameter indicates whether the first argument of the cryptlib call should be used (and the retrieved value returned) or not.
48* {{crypt-ca-get-item}} returns the result retrieved in the second parameter to the cryptlib call
49* {{crypt-check-signature-ex}} returns the result retrieved in the last parameter to the cryptlib call if its optional argument is true
50* {{crypt-create-cert}} returns the result retrieved in the first parameter to the cryptlib call
51* {{crypt-create-context}} returns the result retrieved in the first parameter to the cryptlib call
52* {{crypt-create-envelope}} returns the result retrieved in the first parameter to the cryptlib call
53* {{crypt-create-session}} returns the result retrieved in the first parameter to the cryptlib call
54* {{crypt-create-signature}} returns the result retrieved in the first two parameters to the cryptlib call as a string
55* {{crypt-create-signature-ex}} returns the result retrieved in the first parameter to the cryptlib call as a string
56* {{crypt-device-create-context}} returns the result retrieved in the second parameter to the cryptlib call
57* {{crypt-device-open}} returns the result retrieved in the first parameter to the cryptlib call
58* {{crypt-device-query-capability}} returns the following values
59** name of the algorithm
60** block size
61** minimum key size
62** standard key size
63** maximum key size
64* {{crypt-export-cert}} returns the result retrieved in the first two parameters to the cryptlib call as a string
65* {{crypt-export-key}} returns the result retrieved in the first two parameters to the cryptlib call as a string
66* {{crypt-export-key-ex}} returns the result retrieved in the first two parameters to the cryptlib call as a string
67* {{crypt-get-attribute}} returns the result retrieved in the last parameter to the cryptlib call
68* {{crypt-get-attribute-string}} returns the result retrieved in the  last two parameters to the cryptlib call as a string
69* {{crypt-get-cert-extension}} returns the data retrieved in the last two parameters to the cryptlib call as a string and the critical flag as a boolean
70* {{crypt-get-private-key}} returns the data retrieved in the 3rd parameter to the cryptlib call
71* {{crypt-get-publib-key}} returns the data retrieved in the second parameter to the cryptlib call
72* {{crypt-import-cert}} returns the data retrieved in the last parameter to the cryptlib call. Also note that the parameters have been reordered (user is the first now) to let the length parameter be optional
73* {{crypt-keyset-open}} returns the data retrieved in the first parameter to the cryptlib call.
74* {{crypt-pop-data}} returns the buffer and the number of bytes read into it. also note that the sequence (and number) of parameters is different from the original cryptlib version
75* {{crypt-push-data}} returns the number of bytes copied from the buffer
76* {{crypt-query-capability}} returns the following values
77** name of the algorithm
78** block size
79** minimum key size
80** standard key size
81** maximum key size
82* {{crypt-query-object}} returns the following values
83** the object type
84** the encryption algorithm
85** the encryption mode
86** the hash algorithm
87** the salt for derived keys
88** the size of the salt
89
90In addition two wrappers for {{crypt-pop-data}} and {{crypt-push-data}} are
91provided:
92
93* {{crypt-input-port}} is given a cryplib session or envelope object and returns an input port which wraps calls to crypt-pop-data. closing the port does NOT destroy the underlying cryptlib object.
94* {{crypt-output-port}} is given a cryptlib session or envelope object and returns an output port which wraps calls to crypt-push-data. closing the port does NOT destroy the underlying cryptlib object.
95
96=== Changelog
97
98* 1.1 Replaced use of {{(end-of-file)}} with {{#!eof}}
99* 1.0 Initial release
100
101
102=== License
103
104  Copyright (c) 2004 by Thomas Christian Chust <chust@web.de>.
105  All rights reserved.
106 
107  Redistribution and use in source and binary forms, with or
108  without modification, are permitted provided that the following
109  conditions are met:
110 
111  * Redistributions of source code must retain the above copyright
112    notice, this list of conditions and the following disclaimer.
113  * Redistributions in binary form must reproduce the above
114    copyright notice, this list of conditions and the following
115    disclaimer in the documentation and/or other materials provided
116    with the distribution.
117  * Neither the name of the author nor the names of its
118    contributors may be used to endorse or promote products derived
119    from this software without specific prior written permission.
120 
121  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
122  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
123  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
124  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
125  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
126  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
127  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
128  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
129  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
130  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
131  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
132  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
133  POSSIBILITY OF SUCH DAMAGE.
Note: See TracBrowser for help on using the repository browser.