2011-08-25 23:41:19 +04:00
|
|
|
/* asn_public.h
|
2011-06-03 02:43:27 +04:00
|
|
|
*
|
2014-04-12 01:58:58 +04:00
|
|
|
* Copyright (C) 2006-2014 wolfSSL Inc.
|
2011-06-03 02:43:27 +04:00
|
|
|
*
|
|
|
|
* This file is part of CyaSSL.
|
|
|
|
*
|
|
|
|
* CyaSSL is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* CyaSSL is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2014-04-12 01:58:58 +04:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
2011-06-03 02:43:27 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef CTAO_CRYPT_ASN_PUBLIC_H
|
|
|
|
#define CTAO_CRYPT_ASN_PUBLIC_H
|
|
|
|
|
2011-08-25 23:41:19 +04:00
|
|
|
#include <cyassl/ctaocrypt/types.h>
|
2013-11-15 03:00:22 +04:00
|
|
|
#include <cyassl/ctaocrypt/ecc.h>
|
2011-06-04 00:01:45 +04:00
|
|
|
#ifdef CYASSL_CERT_GEN
|
2011-08-25 23:41:19 +04:00
|
|
|
#include <cyassl/ctaocrypt/rsa.h>
|
2011-06-04 00:01:45 +04:00
|
|
|
#endif
|
|
|
|
|
2014-12-31 20:28:13 +03:00
|
|
|
#include <wolfssl/wolfcrypt/asn_public.h>
|
|
|
|
|
|
|
|
#ifndef HAVE_FIPS
|
|
|
|
#ifdef WOLFSSL_CERT_GEN
|
|
|
|
#define InitCert wc_InitCert
|
|
|
|
#define MakeCert wc_MakeCert
|
|
|
|
#ifdef WOLFSSL_CERT_REQ
|
|
|
|
#define MakeCertReq wc_MakeCertReq
|
|
|
|
#endif
|
|
|
|
#define SignCert wc_SignCert
|
|
|
|
#define MakeSelfCert wc_MakeSelfCert
|
|
|
|
#define SetIssuer wc_SetIssuer
|
|
|
|
#define SetSubject wc_SetSubject
|
|
|
|
#ifdef WOLFSSL_ALT_NAMES
|
|
|
|
#define SetAltNames wc_SetAltNames
|
2011-06-03 02:43:27 +04:00
|
|
|
#endif
|
2014-12-31 20:28:13 +03:00
|
|
|
#define SetIssuerBuffer wc_SetIssuerBuffer
|
|
|
|
#define SetSubjectBuffer wc_SetSubjectBuffer
|
|
|
|
#define SetAltNamesBuffer wc_SetAltNamesBuffer
|
|
|
|
#define SetDatesBuffer wc_SetDatesBuffer
|
2011-06-03 02:43:27 +04:00
|
|
|
|
2014-12-31 20:28:13 +03:00
|
|
|
#ifdef HAVE_NTRU
|
|
|
|
#define MakeNtruCert wc_MakeNtruCert
|
|
|
|
#endif
|
2011-06-03 02:43:27 +04:00
|
|
|
|
2014-12-31 20:28:13 +03:00
|
|
|
#endif /* WOLFSSL_CERT_GEN */
|
|
|
|
#if defined(WOLFSSL_KEY_GEN) || defined(WOLFSSL_CERT_GEN)
|
|
|
|
#define DerToPem wc_DerToPem
|
|
|
|
#endif
|
2014-05-23 18:42:37 +04:00
|
|
|
|
2014-12-31 20:28:13 +03:00
|
|
|
#ifdef HAVE_ECC
|
|
|
|
/* private key helpers */
|
|
|
|
#define EccPrivateKeyDecode wc_EccPrivateKeyDecode
|
|
|
|
#define EccKeyToDer wc_EccKeyToDer
|
|
|
|
#endif
|
2011-10-27 00:23:03 +04:00
|
|
|
|
2014-12-31 20:28:13 +03:00
|
|
|
/* DER encode signature */
|
|
|
|
#define EncodeSignature wc_EncodeSignature
|
|
|
|
#define GetCTC_HashOID wc_GetCTC_HashOID
|
2011-06-04 00:01:45 +04:00
|
|
|
|
2014-12-31 20:28:13 +03:00
|
|
|
#else
|
2013-11-15 03:00:22 +04:00
|
|
|
|
2014-12-31 20:28:13 +03:00
|
|
|
#define WOLFSSL_CERT_GEN CYASSL_CERTGEN
|
|
|
|
#define WOLFSSL_CERT_REQ CYASSL_CERT_REQ
|
|
|
|
#define WOLFSSL_ALT_NAMES CYASSL_ALT_NAMES
|
|
|
|
|
|
|
|
#ifdef WOLFSSL_CERT_GEN
|
|
|
|
#define wc_InitCert InitCert
|
|
|
|
#define wc_MakeCert MakeCert
|
|
|
|
#ifdef WOLFSSL_CERT_REQ
|
|
|
|
#define wc_MakeCertReq MakeCertReq
|
2014-01-08 05:25:46 +04:00
|
|
|
#endif
|
2014-12-31 20:28:13 +03:00
|
|
|
#define wc_SignCert SignCert
|
|
|
|
#define wc_MakeSelfCert MakeSelfCert
|
|
|
|
#define wc_SetIssuer SetIssuer
|
|
|
|
#define wc_SetSubject SetSubject
|
|
|
|
#ifdef WOLFSSL_ALT_NAMES
|
|
|
|
#define wc_SetAltNames SetAltNames
|
2012-04-05 23:48:28 +04:00
|
|
|
#endif
|
2014-12-31 20:28:13 +03:00
|
|
|
#define wc_SetIssuerBuffer SetIssuerBuffer
|
|
|
|
#define wc_SetSubjectBuffer SetSubjectBuffer
|
|
|
|
#define wc_SetAltNamesBuffer SetAltNamesBuffer
|
|
|
|
#define wc_SetDatesBuffer SetDatesBuffer
|
2011-06-04 00:01:45 +04:00
|
|
|
|
|
|
|
#ifdef HAVE_NTRU
|
2014-12-31 20:28:13 +03:00
|
|
|
#define wc_MakeNtruCert MakeNtruCert
|
2011-06-04 00:01:45 +04:00
|
|
|
#endif
|
|
|
|
|
2014-12-31 20:28:13 +03:00
|
|
|
#endif /* WOLFSSL_CERT_GEN */
|
|
|
|
#if defined(WOLFSSL_KEY_GEN) || defined(WOLFSSL_CERT_GEN)
|
|
|
|
#define wc_DerToPem DerToPem
|
2011-06-03 02:43:27 +04:00
|
|
|
#endif
|
|
|
|
|
2013-11-15 03:00:22 +04:00
|
|
|
#ifdef HAVE_ECC
|
|
|
|
/* private key helpers */
|
2014-12-31 20:28:13 +03:00
|
|
|
#define wc_EccPrivateKeyDecode EccPrivateKeyDecode
|
|
|
|
#define wc_EccKeyToDer EccKeyToDer
|
2013-11-15 03:00:22 +04:00
|
|
|
#endif
|
|
|
|
|
2014-11-08 02:33:38 +03:00
|
|
|
/* DER encode signature */
|
2014-12-31 20:28:13 +03:00
|
|
|
#define wc_EncodeSignature EncodeSignature
|
|
|
|
#define wc_GetCTC_HashOID GetCTC_HashOID
|
|
|
|
#endif /* HAVE_FIPS */
|
|
|
|
#endif /* CTA_CRYPT_ASN_PUBLIC_H */
|
2011-06-03 02:43:27 +04:00
|
|
|
|