/*
* 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 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _KEYSTORE_H
#define _KEYSTORE_H
/*
* Module: keystore.h
* Description: This module contains the structure definitions for processing
* package keystore files.
*/
#ifdef __cplusplus
extern "C" {
#endif
#include "pkgerr.h"
/* keystore structures */
/* this opaque type represents a keystore */
typedef void *keystore_handle_t;
/* flags passed to open_keystore */
/* opens keystore read-only. Attempts to modify results in an error */
/* opens keystore read-write */
/*
* tells open_keystore to fall back to app-generic paths in the case that
* the app-specific paths do not exist.
*/
/*
* tells open_keystore to use the app-specific paths no matter what,
* failing if they cannot be used for any reason.
*/
/* masks off various types of flags */
/* default is read-only, soft */
#define KEYSTORE_DFLT_FLAGS \
/*
* possible encoding formats used by the library, used
* by print_cert
*/
typedef enum {
/*
* structure passed back to password callback for determining how
* to prompt for passphrase, and where to record errors
*/
typedef struct {
/* max length of a passphrase. One could use a short story! */
/* callback for collecting passphrase when open_keystore() is called */
typedef int keystore_passphrase_cb(char *, int, int, void *);
/* names of the individual files within the keystore path */
/* keystore.c */
extern int open_keystore(PKG_ERR *, char *, char *,
char *, keystore_handle_t);
char *);
#ifdef __cplusplus
}
#endif
#endif /* _KEYSTORE_H */