Set IV on decryption.
[catacomb-perl] / key.xs
1 # ---?---
2 #
3 # $Id: key.xs,v 1.2 2004/04/08 01:36:21 mdw Exp $
4 #
5 # Key-management interface
6 #
7 # (c) 2001 Straylight/Edgeware
8 #
9
10 #----- Licensing notice -----------------------------------------------------
11 #
12 # This file is part of the Perl interface to Catacomb.
13 #
14 # Catacomb/Perl is free software; you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation; either version 2 of the License, or
17 # (at your option) any later version.
18 #
19 # Catacomb/Perl is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
23 #
24 # You should have received a copy of the GNU General Public License
25 # along with Catacomb/Perl; if not, write to the Free Software Foundation,
26 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27
28 MODULE = Catacomb PACKAGE = Catacomb::Key
29
30 MODULE = Catacomb PACKAGE = Catacomb::Key::Data
31
32 MODULE = Catacomb PACKAGE = Catacomb::Key::File PREFIX = key_
33
34 Key_File *
35 new(file, how)
36 char *file
37 unsigned how
38 CODE:
39 RETVAL = CREATE(key_file);
40 if (key_open(RETVAL, file, how, warn_keyreporter, 0)) {
41 DESTROY(RETVAL);
42 RETVAL = 0;
43 }
44 OUTPUT:
45 RETVAL
46
47 SV *
48 DESTROY(kf)
49 Key_File *kf
50 CODE:
51 key_close(kf);
52 XSRETURN_UNDEF;
53
54 KEYERR
55 merge(kf, name, fp)
56 Key_File *kf
57 char *name
58 FILE *fp
59 CODE:
60 RETVAL = key_merge(kf, name, fp, warn_keyreporter, 0);
61 OUTPUT:
62 RETVAL
63
64 SV *
65 extract
66
67 #----- That's all, folks ----------------------------------------------------