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