df8bdeb362277e8d95a74d6c097341fe97409948johnz * CDDL HEADER START
df8bdeb362277e8d95a74d6c097341fe97409948johnz * The contents of this file are subject to the terms of the
df8bdeb362277e8d95a74d6c097341fe97409948johnz * Common Development and Distribution License (the "License").
df8bdeb362277e8d95a74d6c097341fe97409948johnz * You may not use this file except in compliance with the License.
df8bdeb362277e8d95a74d6c097341fe97409948johnz * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
df8bdeb362277e8d95a74d6c097341fe97409948johnz * See the License for the specific language governing permissions
df8bdeb362277e8d95a74d6c097341fe97409948johnz * and limitations under the License.
df8bdeb362277e8d95a74d6c097341fe97409948johnz * When distributing Covered Code, include this CDDL HEADER in each
df8bdeb362277e8d95a74d6c097341fe97409948johnz * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
df8bdeb362277e8d95a74d6c097341fe97409948johnz * If applicable, add the following below this CDDL HEADER, with the
df8bdeb362277e8d95a74d6c097341fe97409948johnz * fields enclosed by brackets "[]" replaced with your own identifying
df8bdeb362277e8d95a74d6c097341fe97409948johnz * information: Portions Copyright [yyyy] [name of copyright owner]
df8bdeb362277e8d95a74d6c097341fe97409948johnz * CDDL HEADER END
9b009fc1b553084f6003dcd46b171890049de0ffValerie Bubb Fenwick * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern "C" {
df8bdeb362277e8d95a74d6c097341fe97409948johnz * libelfsign Private Interfaces
9b009fc1b553084f6003dcd46b171890049de0ffValerie Bubb Fenwick * This header file should not be shipped as part of Solaris binary or
df8bdeb362277e8d95a74d6c097341fe97409948johnz * source products.
df8bdeb362277e8d95a74d6c097341fe97409948johnz * Certificate-related definitions
df8bdeb362277e8d95a74d6c097341fe97409948johnz#define ELFSIGN_CRYPTO "Solaris Cryptographic Framework"
df8bdeb362277e8d95a74d6c097341fe97409948johnz * libelfsign actions
df8bdeb362277e8d95a74d6c097341fe97409948johnz * Context for elfsign operation
df8bdeb362277e8d95a74d6c097341fe97409948johnz void (*es_sigvercallback)(void *, void *, size_t, ELFCert_t);
df8bdeb362277e8d95a74d6c097341fe97409948johnz void (*es_certvercallback)(void *, ELFCert_t, ELFCert_t);
df8bdeb362277e8d95a74d6c097341fe97409948johnz * ELF signature handling
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern struct filesignatures *elfsign_insert_dso(ELFsign_t ess,
df8bdeb362277e8d95a74d6c097341fe97409948johnz struct filesignatures *fsp, const char *dn, int dn_len,
df8bdeb362277e8d95a74d6c097341fe97409948johnz const uchar_t *sig, int sig_len, const char *oid, int oid_len);
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern filesig_vers_t elfsign_extract_sig(ELFsign_t ess,
df8bdeb362277e8d95a74d6c097341fe97409948johnz struct filesignatures *fsp, uchar_t *sig, size_t *sig_len);
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern ELFsign_status_t elfsign_setcertpath(ELFsign_t ess, const char *path);
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern ELFsign_status_t elfsign_verify_signature(ELFsign_t ess,
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern ELFsign_status_t elfsign_hash(ELFsign_t ess, uchar_t *hash,
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern ELFsign_status_t elfsign_hash_mem_resident(ELFsign_t ess,
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern void elfsign_buffer_len(ELFsign_t ess, size_t *ip, uchar_t *cp,
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern void elfsign_setcallbackctx(ELFsign_t ess, void *ctx);
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern ELFsign_status_t elfsign_signatures(ELFsign_t ess,
df8bdeb362277e8d95a74d6c097341fe97409948johnz struct filesignatures **fspp, size_t *fs_len, enum ES_ACTION action);
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern boolean_t elfsign_sig_info(struct filesignatures *fssp,
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern void elfsign_sig_info_free(struct ELFsign_sig_info *);
df8bdeb362277e8d95a74d6c097341fe97409948johnz * ELF "Certificate Library"
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern const char _PATH_ELFSIGN_CERTS[];
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern boolean_t elfcertlib_settoken(ELFsign_t, char *);
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern void elfcertlib_setcertCAcallback(ELFsign_t ess,
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern void elfcertlib_setcertvercallback(ELFsign_t ess,
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern boolean_t elfcertlib_getcert(ELFsign_t ess, char *cert_pathname,
df8bdeb362277e8d95a74d6c097341fe97409948johnz char *signer_DN, ELFCert_t *certp, enum ES_ACTION action);
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern void elfcertlib_releasecert(ELFsign_t, ELFCert_t);
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern boolean_t elfcertlib_loadprivatekey(ELFsign_t ess, ELFCert_t cert,
df8bdeb362277e8d95a74d6c097341fe97409948johnz const char *path);
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern boolean_t elfcertlib_loadtokenkey(ELFsign_t ess, ELFCert_t cert,
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern boolean_t elfcertlib_sign(ELFsign_t ess, ELFCert_t cert,
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern boolean_t elfcertlib_verifycert(ELFsign_t ess, ELFCert_t cert);
df8bdeb362277e8d95a74d6c097341fe97409948johnzextern boolean_t elfcertlib_verifysig(ELFsign_t ess, ELFCert_t cert,
df8bdeb362277e8d95a74d6c097341fe97409948johnz#endif /* _LIBELFSIGN_H */