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
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.
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]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
36 #include <security/pkcs11t.h>
37 #include "softObject.h"
38 #include "softSession.h"
40 #define KEYGEN_RETRY 3
43 * Function Prototypes.
45 CK_RV
soft_genkey(soft_session_t
*, CK_MECHANISM_PTR
,
46 CK_ATTRIBUTE_PTR
, CK_ULONG
, CK_OBJECT_HANDLE_PTR
);
48 CK_RV
soft_genkey_pair(soft_session_t
*, CK_MECHANISM_PTR
, CK_ATTRIBUTE_PTR
,
49 CK_ULONG
, CK_ATTRIBUTE_PTR
, CK_ULONG
, CK_OBJECT_HANDLE_PTR
,
50 CK_OBJECT_HANDLE_PTR
);
52 CK_RV
soft_derivekey(soft_session_t
*, CK_MECHANISM_PTR
, soft_object_t
*,
53 CK_ATTRIBUTE_PTR
, CK_ULONG
, CK_OBJECT_HANDLE_PTR
);
55 void soft_derive_enforce_flags(soft_object_t
*, soft_object_t
*);
57 CK_RV
soft_gen_keyobject(CK_ATTRIBUTE_PTR
, CK_ULONG
,
58 CK_ULONG
*, soft_session_t
*, CK_OBJECT_CLASS
, CK_KEY_TYPE
,
59 CK_ULONG
, CK_ULONG
, boolean_t
);
61 CK_RV
soft_generate_pkcs5_pbkdf2_key(soft_session_t
*, CK_MECHANISM_PTR
,
64 CK_RV
soft_wrapkey(soft_session_t
*, CK_MECHANISM_PTR
, soft_object_t
*,
65 soft_object_t
*, CK_BYTE_PTR
, CK_ULONG_PTR
);
67 CK_RV
soft_unwrapkey(soft_session_t
*, CK_MECHANISM_PTR
, soft_object_t
*,
68 CK_BYTE_PTR
, CK_ULONG
, CK_ATTRIBUTE_PTR
, CK_ULONG
,
69 CK_OBJECT_HANDLE_PTR
);
75 #endif /* _SOFTKEYS_H */