Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / lib / libkmf / include / kmfmapper.h
blob43470ee3bbc266e16bde832e2d6acd9bd8dff355
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
21 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
23 * This is a private header file for the KMF certificate to name mapping
24 * framework.
26 #ifndef _KMFMAPPER_H
27 #define _KMFMAPPER_H
29 #pragma ident "@(#)kmfmapper.h 1.1 08/02/27 SMI"
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
35 #define MAPPER_NAME_TEMPLATE "kmf_mapper_%s.so.1"
37 #define MAPPER_ERROR_STRING_FUNCTION "mapper_get_error_str"
38 #define MAP_CERT_TO_NAME_FUNCTION "mapper_map_cert_to_name"
39 #define MATCH_CERT_TO_NAME_FUNCTION "mapper_match_cert_to_name"
40 #define MAPPER_FINISH_FUNCTION "mapper_finalize"
41 #define MAPPER_INIT_FUNCTION "mapper_initialize"
43 /* KMF mapper policy record. */
44 typedef struct {
46 * Those four attributes are initialized from the policy database and
47 * are not to be changed for the life of the KMF session.
49 char *mapname;
50 char *options;
51 char *pathname;
52 char *dir;
53 /* Current mapper. */
54 void *dldesc;
56 * The presently open mapper pathname and options. Can be based on the
57 * policy attributes or attributes provided directly to the
58 * kmf_cert_to_name_mapping_init(), thus overriding the policy settings.
60 char *curpathname;
61 char *curoptions;
62 } KMF_MAPPER_RECORD;
64 /* KMF mapper state record. */
65 typedef struct {
67 * (Processed) options. Transparent to KMF. Each mapper can store its
68 * data there since options can be unique to every KMF handle.
70 void *options;
72 * If the mapper returns KMF_ERR_INTERNAL the application may ask for
73 * the internal mapper error string. That error code is stored here.
75 uint32_t lastmappererr;
76 } KMF_MAPPER_STATE;
78 #ifdef __cplusplus
80 #endif
81 #endif /* _KMFMAPPER_H */