Xuyi Wang / wolfSSL

Dependents:   OS

Committer:
wolfSSL
Date:
Sat Aug 18 22:20:43 2018 +0000
Revision:
15:117db924cf7c
wolfSSL 3.15.3

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 15:117db924cf7c 1 /* pkcs12.h
wolfSSL 15:117db924cf7c 2 *
wolfSSL 15:117db924cf7c 3 * Copyright (C) 2006-2017 wolfSSL Inc.
wolfSSL 15:117db924cf7c 4 *
wolfSSL 15:117db924cf7c 5 * This file is part of wolfSSL.
wolfSSL 15:117db924cf7c 6 *
wolfSSL 15:117db924cf7c 7 * wolfSSL is free software; you can redistribute it and/or modify
wolfSSL 15:117db924cf7c 8 * it under the terms of the GNU General Public License as published by
wolfSSL 15:117db924cf7c 9 * the Free Software Foundation; either version 2 of the License, or
wolfSSL 15:117db924cf7c 10 * (at your option) any later version.
wolfSSL 15:117db924cf7c 11 *
wolfSSL 15:117db924cf7c 12 * wolfSSL is distributed in the hope that it will be useful,
wolfSSL 15:117db924cf7c 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
wolfSSL 15:117db924cf7c 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wolfSSL 15:117db924cf7c 15 * GNU General Public License for more details.
wolfSSL 15:117db924cf7c 16 *
wolfSSL 15:117db924cf7c 17 * You should have received a copy of the GNU General Public License
wolfSSL 15:117db924cf7c 18 * along with this program; if not, write to the Free Software
wolfSSL 15:117db924cf7c 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
wolfSSL 15:117db924cf7c 20 */
wolfSSL 15:117db924cf7c 21
wolfSSL 15:117db924cf7c 22
wolfSSL 15:117db924cf7c 23 #ifndef WOLF_CRYPT_PKCS12_H
wolfSSL 15:117db924cf7c 24 #define WOLF_CRYPT_PKCS12_H
wolfSSL 15:117db924cf7c 25
wolfSSL 15:117db924cf7c 26 #include <wolfssl/wolfcrypt/types.h>
wolfSSL 15:117db924cf7c 27
wolfSSL 15:117db924cf7c 28 #ifdef __cplusplus
wolfSSL 15:117db924cf7c 29 extern "C" {
wolfSSL 15:117db924cf7c 30 #endif
wolfSSL 15:117db924cf7c 31
wolfSSL 15:117db924cf7c 32 #ifndef WOLFSSL_TYPES_DEFINED /* do not redeclare from ssl.h */
wolfSSL 15:117db924cf7c 33 typedef struct WC_PKCS12 WC_PKCS12;
wolfSSL 15:117db924cf7c 34 #endif
wolfSSL 15:117db924cf7c 35
wolfSSL 15:117db924cf7c 36 typedef struct WC_DerCertList { /* dereferenced in ssl.c */
wolfSSL 15:117db924cf7c 37 byte* buffer;
wolfSSL 15:117db924cf7c 38 word32 bufferSz;
wolfSSL 15:117db924cf7c 39 struct WC_DerCertList* next;
wolfSSL 15:117db924cf7c 40 } WC_DerCertList;
wolfSSL 15:117db924cf7c 41
wolfSSL 15:117db924cf7c 42 /* default values for creating PKCS12 */
wolfSSL 15:117db924cf7c 43 enum {
wolfSSL 15:117db924cf7c 44 WC_PKCS12_ITT_DEFAULT = 2048,
wolfSSL 15:117db924cf7c 45 WC_PKCS12_MAC_DEFAULT = 1,
wolfSSL 15:117db924cf7c 46 };
wolfSSL 15:117db924cf7c 47
wolfSSL 15:117db924cf7c 48 WOLFSSL_API WC_PKCS12* wc_PKCS12_new(void);
wolfSSL 15:117db924cf7c 49 WOLFSSL_API void wc_PKCS12_free(WC_PKCS12* pkcs12);
wolfSSL 15:117db924cf7c 50 WOLFSSL_API int wc_d2i_PKCS12(const byte* der, word32 derSz, WC_PKCS12* pkcs12);
wolfSSL 15:117db924cf7c 51 WOLFSSL_API int wc_PKCS12_parse(WC_PKCS12* pkcs12, const char* psw,
wolfSSL 15:117db924cf7c 52 byte** pkey, word32* pkeySz, byte** cert, word32* certSz,
wolfSSL 15:117db924cf7c 53 WC_DerCertList** ca);
wolfSSL 15:117db924cf7c 54 WOLFSSL_API WC_PKCS12* wc_PKCS12_create(char* pass, word32 passSz,
wolfSSL 15:117db924cf7c 55 char* name, byte* key, word32 keySz, byte* cert, word32 certSz,
wolfSSL 15:117db924cf7c 56 WC_DerCertList* ca, int nidKey, int nidCert, int iter, int macIter,
wolfSSL 15:117db924cf7c 57 int keyType, void* heap);
wolfSSL 15:117db924cf7c 58
wolfSSL 15:117db924cf7c 59
wolfSSL 15:117db924cf7c 60 WOLFSSL_LOCAL int wc_PKCS12_SetHeap(WC_PKCS12* pkcs12, void* heap);
wolfSSL 15:117db924cf7c 61 WOLFSSL_LOCAL void* wc_PKCS12_GetHeap(WC_PKCS12* pkcs12);
wolfSSL 15:117db924cf7c 62
wolfSSL 15:117db924cf7c 63 WOLFSSL_LOCAL void wc_FreeCertList(WC_DerCertList* list, void* heap);
wolfSSL 15:117db924cf7c 64
wolfSSL 15:117db924cf7c 65 #ifdef __cplusplus
wolfSSL 15:117db924cf7c 66 } /* extern "C" */
wolfSSL 15:117db924cf7c 67 #endif
wolfSSL 15:117db924cf7c 68
wolfSSL 15:117db924cf7c 69 #endif /* WOLF_CRYPT_PKCS12_H */
wolfSSL 15:117db924cf7c 70
wolfSSL 15:117db924cf7c 71