4 * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine
6 * Copyright (C) 2009 Paul Bakker <polarssl_maintainer at polarssl dot org>
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * * Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * * Neither the names of PolarSSL or XySSL nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 #ifndef SVN_LIBSVN_SUBR_X509_H
36 #define SVN_LIBSVN_SUBR_X509_H
46 #define ASN1_BOOLEAN 0x01
47 #define ASN1_INTEGER 0x02
48 #define ASN1_BIT_STRING 0x03
49 #define ASN1_OCTET_STRING 0x04
50 #define ASN1_NULL 0x05
52 #define ASN1_UTF8_STRING 0x0C
53 #define ASN1_SEQUENCE 0x10
55 #define ASN1_PRINTABLE_STRING 0x13
56 #define ASN1_T61_STRING 0x14
57 #define ASN1_IA5_STRING 0x16
58 #define ASN1_UTC_TIME 0x17
59 #define ASN1_GENERALIZED_TIME 0x18
60 #define ASN1_UNIVERSAL_STRING 0x1C
61 #define ASN1_BMP_STRING 0x1E
62 #define ASN1_PRIMITIVE 0x00
63 #define ASN1_CONSTRUCTED 0x20
64 #define ASN1_CONTEXT_SPECIFIC 0x80
67 * various object identifiers
69 #define OID_SUBJECT_ALT_NAME "\x55\x1D\x11"
73 #endif /* __cplusplus */
76 * Structures for parsing X.509 certificates
78 typedef struct _x509_buf
{
81 const unsigned char *p
;
84 typedef struct _x509_name
{
87 struct _x509_name
*next
;
90 typedef struct _x509_cert
{
98 apr_time_t valid_from
;
103 apr_array_header_t
*dnsnames
;
111 struct svn_x509_name_attr_t
{
114 const char *utf8_value
;
118 * Certificate info, returned from the parser
120 struct svn_x509_certinfo_t
122 apr_array_header_t
*issuer
;
123 apr_array_header_t
*subject
;
124 apr_time_t valid_from
;
126 svn_checksum_t
*digest
;
127 apr_array_header_t
*hostnames
;
132 #endif /* __cplusplus */
134 #endif /* SVN_LIBSVN_SUBR_X509_H */