This module implements Base64 Decoder.
Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "common/include/nm_common.h"
#include "pem.h"
Data Structures | |
struct | tstrPemDecInfo |
Functions | |
sint8 | Base64_Decode (uint8 *pu8EncData, uint32 u32EncLength, uint8 **ppu8DecData, uint32 *pu32DecLen) |
static void | Base64_DecodeBlock (uint8 *pu8B64Data, uint8 *pu8BinData) |
sint8 | DecodeBase64File (uint8 *pu8B64File, uint32 u32FileSize, uint8 **ppu8Key, uint32 *pu32KeySize, tenuPEMEncType *penuPemType) |
sint8 | DecodeX509Certificate (uint8 *pu8X509File, uint32 u32X509FileSz, uint8 **ppu8X509Der, uint32 *pu32X509Size) |
Variables | |
const tstrPemDecInfo | gastrPemTypes [] |
static const uint8 | gpau8Ascii2B64 [128] |
sint8 Base64_Decode | ( | uint8 * | pu8EncData, |
uint32 | u32EncLength, | ||
uint8 ** | ppu8DecData, | ||
uint32 * | pu32DecLen | ||
) |
References Base64_DecodeBlock(), and NULL.
Referenced by DecodeBase64File().
References gpau8Ascii2B64.
Referenced by Base64_Decode().
sint8 DecodeBase64File | ( | uint8 * | pu8B64File, |
uint32 | u32FileSize, | ||
uint8 ** | ppu8Key, | ||
uint32 * | pu32KeySize, | ||
tenuPEMEncType * | penuPemType | ||
) |
References tstrPemDecInfo::acBeginPhrase, tstrPemDecInfo::acEndPhrase, Base64_Decode(), tstrPemDecInfo::enuType, gastrPemTypes, M2M_ERR_FAIL, M2M_SUCCESS, NULL, and PEM_TYPE_NONE.
Referenced by CryptoDecodeRsaPrivKey(), and DecodeX509Certificate().
sint8 DecodeX509Certificate | ( | uint8 * | pu8X509File, |
uint32 | u32X509FileSz, | ||
uint8 ** | ppu8X509Der, | ||
uint32 * | pu32X509Size | ||
) |
References DecodeBase64File().
Referenced by GetRootCertificate(), and WriteTlsServerKeyMaterial().
const tstrPemDecInfo gastrPemTypes[] |
Referenced by DecodeBase64File().
|
static |
Referenced by Base64_DecodeBlock().