xref: /titanic_50/usr/src/lib/pkcs11/pkcs11_softtoken/common/softOps.h (revision 74e20cfe817b82802b16fac8690dadcda76f54f5)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SOFTOPS_H
28 #define	_SOFTOPS_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include <security/pkcs11t.h>
37 #include "softObject.h"
38 #include "softSession.h"
39 
40 /*
41  * Function Prototypes.
42  */
43 CK_RV soft_digest_init(soft_session_t *, CK_MECHANISM_PTR);
44 
45 CK_RV soft_digest(soft_session_t *, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR,
46 	CK_ULONG_PTR);
47 
48 CK_RV soft_digest_update(soft_session_t *, CK_BYTE_PTR, CK_ULONG);
49 
50 CK_RV soft_digest_final(soft_session_t *, CK_BYTE_PTR, CK_ULONG_PTR);
51 
52 CK_RV soft_digest_init_internal(soft_session_t *, CK_MECHANISM_PTR);
53 
54 CK_RV soft_digest_key(soft_session_t *, soft_object_t *);
55 
56 CK_RV soft_encrypt_init(soft_session_t *, CK_MECHANISM_PTR, soft_object_t *);
57 
58 CK_RV soft_encrypt(soft_session_t *, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR,
59 	CK_ULONG_PTR);
60 
61 CK_RV soft_encrypt_update(soft_session_t *, CK_BYTE_PTR, CK_ULONG,
62 	CK_BYTE_PTR, CK_ULONG_PTR);
63 
64 CK_RV soft_encrypt_final(soft_session_t *, CK_BYTE_PTR, CK_ULONG_PTR);
65 
66 CK_RV soft_encrypt_init_internal(soft_session_t *, CK_MECHANISM_PTR,
67 	soft_object_t *);
68 
69 CK_RV soft_decrypt_init(soft_session_t *, CK_MECHANISM_PTR, soft_object_t *);
70 
71 CK_RV soft_decrypt(soft_session_t *, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR,
72 	CK_ULONG_PTR);
73 
74 CK_RV soft_decrypt_update(soft_session_t *, CK_BYTE_PTR, CK_ULONG,
75 	CK_BYTE_PTR, CK_ULONG_PTR);
76 
77 CK_RV soft_decrypt_final(soft_session_t *, CK_BYTE_PTR, CK_ULONG_PTR);
78 
79 CK_RV soft_sign_init(soft_session_t *, CK_MECHANISM_PTR, soft_object_t *);
80 
81 CK_RV soft_sign(soft_session_t *, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR,
82 	CK_ULONG_PTR);
83 
84 CK_RV soft_sign_update(soft_session_t *, CK_BYTE_PTR, CK_ULONG);
85 
86 CK_RV soft_sign_final(soft_session_t *, CK_BYTE_PTR, CK_ULONG_PTR);
87 
88 CK_RV soft_verify_init(soft_session_t *, CK_MECHANISM_PTR, soft_object_t *);
89 
90 CK_RV soft_verify(soft_session_t *, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR,
91 	CK_ULONG);
92 
93 CK_RV soft_verify_update(soft_session_t *, CK_BYTE_PTR, CK_ULONG);
94 
95 CK_RV soft_verify_final(soft_session_t *, CK_BYTE_PTR, CK_ULONG);
96 
97 CK_RV soft_sign_recover_init(soft_session_t *, CK_MECHANISM_PTR,
98 	soft_object_t *);
99 
100 CK_RV soft_sign_recover(soft_session_t *, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR,
101 	CK_ULONG_PTR);
102 
103 CK_RV soft_verify_recover_init(soft_session_t *, CK_MECHANISM_PTR,
104 	soft_object_t *);
105 
106 CK_RV soft_verify_recover(soft_session_t *, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR,
107 	CK_ULONG_PTR);
108 
109 void soft_crypt_cleanup(soft_session_t *, boolean_t, boolean_t);
110 
111 void soft_sign_verify_cleanup(soft_session_t *, boolean_t, boolean_t);
112 
113 #ifdef	__cplusplus
114 }
115 #endif
116 
117 #endif /* _SOFTOPS_H */
118