Initial commit

Dependencies:   FastPWM

Committer:
lypinator
Date:
Wed Sep 16 01:11:49 2020 +0000
Revision:
0:bb348c97df44
Added PWM

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lypinator 0:bb348c97df44 1 /*---------------------------------------------------------------------------
lypinator 0:bb348c97df44 2 * Copyright (c) 2016, u-blox Malmö, All Rights Reserved
lypinator 0:bb348c97df44 3 * SPDX-License-Identifier: LicenseRef-PBL
lypinator 0:bb348c97df44 4 *
lypinator 0:bb348c97df44 5 * This file and the related binary are licensed under the
lypinator 0:bb348c97df44 6 * Permissive Binary License, Version 1.0 (the "License");
lypinator 0:bb348c97df44 7 * you may not use these files except in compliance with the License.
lypinator 0:bb348c97df44 8 *
lypinator 0:bb348c97df44 9 * You may obtain a copy of the License here:
lypinator 0:bb348c97df44 10 * LICENSE-permissive-binary-license-1.0.txt and at
lypinator 0:bb348c97df44 11 * https://www.mbed.com/licenses/PBL-1.0
lypinator 0:bb348c97df44 12 *
lypinator 0:bb348c97df44 13 * See the License for the specific language governing permissions and
lypinator 0:bb348c97df44 14 * limitations under the License.
lypinator 0:bb348c97df44 15 *
lypinator 0:bb348c97df44 16 * Component : WLAN
lypinator 0:bb348c97df44 17 * File : cb_cert_utils.h
lypinator 0:bb348c97df44 18 *
lypinator 0:bb348c97df44 19 * Description :
lypinator 0:bb348c97df44 20 *-------------------------------------------------------------------------*/
lypinator 0:bb348c97df44 21
lypinator 0:bb348c97df44 22 /**
lypinator 0:bb348c97df44 23 * @file cb_cert_utils.h The main WLAN component interface.
lypinator 0:bb348c97df44 24 * All functions declared extern needs to be provided by another/upper layer.
lypinator 0:bb348c97df44 25 * @ingroup wlan
lypinator 0:bb348c97df44 26 */
lypinator 0:bb348c97df44 27
lypinator 0:bb348c97df44 28 #ifndef _CB_CERT_UTILS_H_
lypinator 0:bb348c97df44 29 #define _CB_CERT_UTILS_H_
lypinator 0:bb348c97df44 30
lypinator 0:bb348c97df44 31 #include "cb_types.h"
lypinator 0:bb348c97df44 32 #include "cb_status.h"
lypinator 0:bb348c97df44 33
lypinator 0:bb348c97df44 34 #ifdef __cplusplus
lypinator 0:bb348c97df44 35 extern "C" {
lypinator 0:bb348c97df44 36 #endif
lypinator 0:bb348c97df44 37
lypinator 0:bb348c97df44 38
lypinator 0:bb348c97df44 39 /*===========================================================================
lypinator 0:bb348c97df44 40 * DEFINES
lypinator 0:bb348c97df44 41 *=========================================================================*/
lypinator 0:bb348c97df44 42 #define cbCERT_CRT_MAX_CHAIN_LENGTH 5ul
lypinator 0:bb348c97df44 43
lypinator 0:bb348c97df44 44 /*===========================================================================
lypinator 0:bb348c97df44 45 * TYPES
lypinator 0:bb348c97df44 46 *=========================================================================*/
lypinator 0:bb348c97df44 47
lypinator 0:bb348c97df44 48 typedef struct cbCERT_Stream_s cbCERT_Stream;
lypinator 0:bb348c97df44 49 typedef cb_uint32 cbCERT_StreamPosition;
lypinator 0:bb348c97df44 50
lypinator 0:bb348c97df44 51 /**
lypinator 0:bb348c97df44 52 * Stream vtable interface used by WLAN supplicant to access SSL certificates
lypinator 0:bb348c97df44 53 * for WPA Enterprise authentication.
lypinator 0:bb348c97df44 54 *
lypinator 0:bb348c97df44 55 * @ingroup wlan
lypinator 0:bb348c97df44 56 */
lypinator 0:bb348c97df44 57 struct cbCERT_Stream_s {
lypinator 0:bb348c97df44 58 cb_int32(*read)(const cbCERT_Stream *stream, void *buf, cb_uint32 count); /**< Read function pointer, place count bytes in buf. */
lypinator 0:bb348c97df44 59 cb_int32(*write)(const cbCERT_Stream *stream, void *buf, cb_uint32 count); /**< Read function pointer, place count bytes in buf. */
lypinator 0:bb348c97df44 60 void(*rewind)(const cbCERT_Stream *stream); /**< Rewind function pointer, rewind stream internal iterator to the beginning. Mandatory for all streams. */
lypinator 0:bb348c97df44 61 void(*setPosition)(const cbCERT_Stream *stream, cbCERT_StreamPosition position); /**< Set absolute position. */
lypinator 0:bb348c97df44 62 cbCERT_StreamPosition(*getPosition)(const cbCERT_Stream *stream); /**< Get current position. */
lypinator 0:bb348c97df44 63 cb_uint32(*getSize)(const cbCERT_Stream *stream); /**< GetSize function pointer, return total size of stream contents. */
lypinator 0:bb348c97df44 64 };
lypinator 0:bb348c97df44 65
lypinator 0:bb348c97df44 66 /*===========================================================================
lypinator 0:bb348c97df44 67 * CERT API
lypinator 0:bb348c97df44 68 *=========================================================================*/
lypinator 0:bb348c97df44 69
lypinator 0:bb348c97df44 70 cbRTSL_Status cbCERT_Util_parseDERCert(cbCERT_Stream const * const certificate, cbCERT_Stream const * const outputStream);
lypinator 0:bb348c97df44 71 cbRTSL_Status cbCERT_Util_parseDERKey(cbCERT_Stream const * const key, cbCERT_Stream const * const outputStream);
lypinator 0:bb348c97df44 72 cbRTSL_Status cbCERT_Util_parsePEMCert(cbCERT_Stream const * const certificate, cbCERT_Stream const * const outputStream);
lypinator 0:bb348c97df44 73 cbRTSL_Status cbCERT_Util_parsePEMKey(cbCERT_Stream const * const certificate, cb_char const * const key, cb_uint32 keyLength, cbCERT_Stream const * const outputStream);
lypinator 0:bb348c97df44 74
lypinator 0:bb348c97df44 75 #ifdef __cplusplus
lypinator 0:bb348c97df44 76 }
lypinator 0:bb348c97df44 77 #endif
lypinator 0:bb348c97df44 78
lypinator 0:bb348c97df44 79 #endif /* _CB_CERT_UTILS_H_ */
lypinator 0:bb348c97df44 80