asn_public.h
1 /* asn_public.h
2  *
3  * Copyright (C) 2006-2020 wolfSSL Inc.
4  *
5  * This file is part of wolfSSL.
6  *
7  * wolfSSL is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * wolfSSL is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20  */
21 
22 
23 
24 #ifndef CTAO_CRYPT_ASN_PUBLIC_H
25 #define CTAO_CRYPT_ASN_PUBLIC_H
26 
27 /* pull in compatibility for each of the includes */
28 #include <cyassl/ctaocrypt/types.h>
29 #include <cyassl/ctaocrypt/types.h>
30 #include <cyassl/ctaocrypt/ecc.h>
31 #ifdef WOLFSSL_CERT_GEN
32  #include <cyassl/ctaocrypt/rsa.h>
33 #endif
34 
36 #ifdef WOLFSSL_CERT_GEN
37  #define InitCert wc_InitCert
38  #define MakeCert wc_MakeCert
39 
40  #ifdef WOLFSSL_CERT_REQ
41  #define MakeCertReq wc_MakeCertReq
42 #endif
43 
44  #define SignCert wc_SignCert
45  #define MakeSelfCert wc_MakeSelfCert
46  #define SetIssuer wc_SetIssuer
47  #define SetSubject wc_SetSubject
48 
49  #ifdef WOLFSSL_ALT_NAMES
50  #define SetAltNames wc_SetAltNames
51 #endif
52 
53  #define SetIssuerBuffer wc_SetIssuerBuffer
54  #define SetSubjectBuffer wc_SetSubjectBuffer
55  #define SetAltNamesBuffer wc_SetAltNamesBuffer
56  #define SetDatesBuffer wc_SetDatesBuffer
57 
58  #ifdef HAVE_NTRU
59  #define MakeNtruCert wc_MakeNtruCert
60  #endif
61 
62 #endif /* WOLFSSL_CERT_GEN */
63 
64  #if defined(WOLFSSL_KEY_GEN) || defined(WOLFSSL_CERT_GEN)
65  #define DerToPem wc_DerToPem
66 #endif
67 
68 #ifdef HAVE_ECC
69  /* private key helpers */
70  #define EccPrivateKeyDecode wc_EccPrivateKeyDecode
71  #define EccKeyToDer wc_EccKeyToDer
72 #endif
73 
74  /* DER encode signature */
75  #define EncodeSignature wc_EncodeSignature
76  #define GetCTC_HashOID wc_GetCTC_HashOID
77 
78 #endif /* CTAO_CRYPT_ASN_PUBLIC_H */
79