8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / common / net / wanboot / p12access.h
blob288274d5b7bb8a9830543d42e14a23e231840f7c
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
23 * Copyright 2002, 2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _P12ACCESS_H
28 #define _P12ACCESS_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 #include <p12aux.h>
37 #include <openssl/ssl.h>
40 * sunw_p12_use_certfile - read a client certificate from a pkcs12 file and
41 * pass it in to SSL.
43 * Read in the certificate in pkcs12-formated file. If there is a pass phrase
44 * use that to decrypt; if no pass phrase was given and there is a callback
45 * routine, call it. Pass the cert to SSL.
47 * Arguments:
48 * ctx - SSL's context structure
49 * filename - Name of file with the client certificate.
50 * passwd - Pass phrase for pkcs12 data.
52 * Returns:
53 * -1 - Error occurred. Check the error stack for specifics.
54 * 0 - Success. Cert was successfully added.
56 int sunw_p12_use_certfile(SSL_CTX *, char *, char *);
59 * sunw_p12_use_keyfile - read a RSA private key from a pkcs12 file and pass
60 * it in to SSL.
62 * Read in the RSA private key in pkcs12 format. If there is a pass phrase
63 * use it to decrypt; if no pass phrase was given and there is a callback
64 * given, call it. Pass the key to SSL.
66 * Arguments:
67 * ctx - SSL's context structure
68 * filename - Name of file with private key.
69 * passwd - Pass phrase for pkcs12 data.
71 * Returns:
72 * -1 - Error occurred. Check the error stack for specifics.
73 * 0 - Success.
75 int sunw_p12_use_keyfile(SSL_CTX *, char *, char *);
78 * sunw_p12_use_trustfile - read a list of trustanchors from a pkcs12 file and
79 * pass the stack in to SSL.
81 * Read in the trust anchors from pkcs12-formated file. If there is a pass
82 * phrase use that to decrypt; if no pass phrase was given and there is a
83 * callback routine, call it. Pass the stack of certs to SSL.
85 * Arguments:
86 * ctx - SSL's context structure
87 * filename - Name of file with the certificates.
88 * passwd - Pass phrase for pkcs12 data.
90 * Returns:
91 * -1 - Error occurred. Check the error stack for specifics.
92 * 0 - Success. Trust anchors were successfully added.
94 int sunw_p12_use_trustfile(SSL_CTX *, char *, char *);
97 #ifdef __cplusplus
99 #endif
101 #endif /* _P12ACCESS_H */