kmfapi.h revision 9f0bc604621fbb9b9b038e6de7da8f9c46e28608
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*
* Constant definitions and function prototypes for the KMF library.
* Commonly used data types are defined in "kmftypes.h".
*/
#ifndef _KMFAPI_H
#define _KMFAPI_H
#include <kmftypes.h>
#include <security/cryptoki.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Setup operations.
*/
/*
* Key operations.
*/
KMF_ATTRIBUTE *);
KMF_RAW_SYM_KEY *);
/*
* Certificate operations.
*/
KMF_ATTRIBUTE *);
char *);
unsigned int, char *, KMF_ENCODE_FORMAT *);
/*
* Crypto operations with key or cert.
*/
/*
* CRL operations.
*/
int, unsigned int, char *, KMF_ENCODE_FORMAT *);
/*
* CSR operations.
*/
KMF_KEY_HANDLE *, KMF_CSR_DATA *);
int, KMF_GENERALNAMECHOICES);
KMF_KEY_HANDLE *, KMF_DATA *);
/*
* GetCert operations.
*/
KMF_X509_EXTENSION **, int *);
char **);
char **);
char **);
char **);
char **);
char **);
char **);
char **);
char **);
char **);
KMF_PRINTABLE_ITEM, char **);
/*
* SetCert operations
*/
KMF_X509_NAME *);
KMF_X509_NAME *);
KMF_BIGINT *);
int, KMF_GENERALNAMECHOICES, char *);
int, KMF_GENERALNAMECHOICES, char *);
/*
* PK12 operations
*/
int, KMF_KEY_HANDLE *, KMF_CREDENTIAL *, char *);
KMF_X509_DER_CERT **, int *, KMF_RAW_KEY_DATA **, int *);
/*
* OCSP operations
*/
KMF_DATA *);
char *, int, char *, int, char *, unsigned int);
KMF_ATTRIBUTE *);
/*
* Policy Operations
*/
/*
* Error handling.
*/
/*
* Miscellaneous
*/
int, unsigned char **, int *);
extern KMF_RETURN kmf_pem_to_der(unsigned char *, int, unsigned char **, int *);
extern char *kmf_oid_to_string(KMF_OID *);
extern uint32_t kmf_string_to_ku(char *);
extern char *kmf_ku_to_string(uint32_t);
extern KMF_RETURN kmf_hexstr_to_bytes(unsigned char *, unsigned char **,
size_t *);
KMF_KEYSTORE_TYPE *, char **);
extern KMF_OID *kmf_ekuname_to_oid(char *);
extern char *kmf_oid_to_ekuname(KMF_OID *);
#define KMF_CompareRDNs kmf_compare_rdns
/*
* Memory cleanup operations
*/
extern void kmf_free_dn(KMF_X509_NAME *);
extern void kmf_free_data(KMF_DATA *);
extern void kmf_free_algoid(KMF_X509_ALGORITHM_IDENTIFIER *);
extern void kmf_free_extn(KMF_X509_EXTENSION *);
extern void kmf_free_tbs_csr(KMF_TBS_CSR *);
extern void kmf_free_signed_csr(KMF_CSR_DATA *);
extern void kmf_free_tbs_cert(KMF_X509_TBS_CERT *);
extern void kmf_free_signed_cert(KMF_X509_CERTIFICATE *);
extern void kmf_free_str(char *);
extern void kmf_free_eku(KMF_X509EXT_EKU *);
extern void kmf_free_spki(KMF_X509_SPKI *);
extern void kmf_free_bigint(KMF_BIGINT *);
extern void kmf_free_raw_key(KMF_RAW_KEY_DATA *);
extern void kmf_free_raw_sym_key(KMF_RAW_SYM_KEY *);
extern void kmf_free_crl_dist_pts(KMF_X509EXT_CRLDISTPOINTS *);
/* APIs for PKCS#11 token */
char *, char *, CK_UTF8CHAR_PTR, CK_ULONG);
/*
* Attribute management routines.
*/
uint32_t *);
void *, uint32_t);
#ifdef __cplusplus
}
#endif
#endif /* _KMFAPI_H */