| 1 |
/* certreq.h - Internal definitions for pkcs-10 objects |
| 2 |
* Copyright (C) 2002, 2005, 2012 g10 Code GmbH |
| 3 |
* |
| 4 |
* This file is part of KSBA. |
| 5 |
* |
| 6 |
* KSBA is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of either |
| 8 |
* |
| 9 |
* - the GNU Lesser General Public License as published by the Free |
| 10 |
* Software Foundation; either version 3 of the License, or (at |
| 11 |
* your option) any later version. |
| 12 |
* |
| 13 |
* or |
| 14 |
* |
| 15 |
* - the GNU General Public License as published by the Free |
| 16 |
* Software Foundation; either version 2 of the License, or (at |
| 17 |
* your option) any later version. |
| 18 |
* |
| 19 |
* or both in parallel, as here. |
| 20 |
* |
| 21 |
* KSBA is distributed in the hope that it will be useful, but WITHOUT |
| 22 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 23 |
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public |
| 24 |
* License for more details. |
| 25 |
* |
| 26 |
* You should have received a copies of the GNU General Public License |
| 27 |
* and the GNU Lesser General Public License along with this program; |
| 28 |
* if not, see <http://www.gnu.org/licenses/>. |
| 29 |
*/ |
| 30 |
|
| 31 |
#ifndef CERTREQ_H |
| 32 |
#define CERTREQ_H 1 |
| 33 |
|
| 34 |
#include "ksba.h" |
| 35 |
|
| 36 |
#ifndef HAVE_TYPEDEFD_ASNNODE |
| 37 |
typedef struct asn_node_struct *AsnNode; /* FIXME: should not go here */ |
| 38 |
#define HAVE_TYPEDEFD_ASNNODE |
| 39 |
#endif |
| 40 |
|
| 41 |
struct extn_list_s |
| 42 |
{ |
| 43 |
struct extn_list_s *next; |
| 44 |
const char *oid; |
| 45 |
int critical; |
| 46 |
int derlen; |
| 47 |
unsigned char der[1]; |
| 48 |
}; |
| 49 |
|
| 50 |
|
| 51 |
/* Object to collect information for building a GeneralNames. */ |
| 52 |
struct general_names_s |
| 53 |
{ |
| 54 |
struct general_names_s *next; |
| 55 |
int tag; /* The GeneralName CHOICE. Only certain values are |
| 56 |
supported. This is not strictly required because DATA |
| 57 |
below has already been prefixed with the DER encoded |
| 58 |
tag. */ |
| 59 |
size_t datalen; /* Length of the data. */ |
| 60 |
char data[1]; /* The actual data: encoded tag, llength and value. */ |
| 61 |
}; |
| 62 |
|
| 63 |
|
| 64 |
struct ksba_certreq_s |
| 65 |
{ |
| 66 |
gpg_error_t last_error; |
| 67 |
|
| 68 |
ksba_writer_t writer; |
| 69 |
|
| 70 |
void (*hash_fnc)(void *, const void *, size_t); |
| 71 |
void *hash_fnc_arg; |
| 72 |
|
| 73 |
int any_build_done; |
| 74 |
|
| 75 |
struct { |
| 76 |
struct { |
| 77 |
char *der; /* Malloced serialno; if this is set we want to |
| 78 |
build a real X.509 certificate. */ |
| 79 |
size_t derlen; |
| 80 |
} serial; |
| 81 |
struct { |
| 82 |
char *der; |
| 83 |
size_t derlen; |
| 84 |
} issuer; |
| 85 |
ksba_isotime_t not_before; |
| 86 |
ksba_isotime_t not_after; |
| 87 |
struct { |
| 88 |
unsigned char *der; |
| 89 |
size_t derlen; |
| 90 |
} siginfo; |
| 91 |
} x509; |
| 92 |
|
| 93 |
struct { |
| 94 |
char *der; |
| 95 |
size_t derlen; |
| 96 |
} subject; |
| 97 |
|
| 98 |
struct { |
| 99 |
unsigned char *der; |
| 100 |
size_t derlen; |
| 101 |
} key; |
| 102 |
|
| 103 |
struct general_names_s *subject_alt_names; |
| 104 |
|
| 105 |
struct extn_list_s *extn_list; |
| 106 |
|
| 107 |
struct { |
| 108 |
unsigned char *der; |
| 109 |
size_t derlen; |
| 110 |
} cri; |
| 111 |
|
| 112 |
struct { |
| 113 |
char *algo; |
| 114 |
int is_ecc; /* 1 = plain ecc, 2 = EdDSA */ |
| 115 |
unsigned char *value; |
| 116 |
size_t valuelen; |
| 117 |
} sig_val; |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
}; |
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
#endif /*CERTREQ_H*/ |