NetBurner 3.5.0
PDF Version
 
certgen.h File Reference

Onboard Self-Signed Certificate Generation. More...

#include <predef.h>
#include <nettypes.h>
#include <nbstring.h>
#include <crypto/ssl.h>
#include <crypto/wolfssl/wolfcrypt/ecc.h>
#include <random.h>
#include <config_obj.h>

Go to the source code of this file.

Classes

struct  CertGenData
 Used to store the information that is passed in when enabling onboard generated certificates, as well as the information needed to determine when they need to be regenerated. More...
 
class  CertData
 

Enumerations

enum  SslKeyType_t {
  SSL_KEY_NONE = 0 , SSL_KEY_RSA_1024 = 1 , SSL_KEY_RSA_2048 , SSL_KEY_RSA_4096 ,
  SSL_KEY_ECC_SECP192R1 = ECC_SECP192R1 , SSL_KEY_ECC_SECP224R1 = ECC_SECP224R1 , SSL_KEY_ECC_SECP256R1 = ECC_SECP256R1 , SSL_KEY_ECC_SECP384R1 = ECC_SECP384R1 ,
  SSL_KEY_ECC_SECP521R1 = ECC_SECP521R1
}
 Certificate Generation Key Types. More...
 
enum  AltNameType_t : char { ALT_NAME_TYPE_NONE = 0 , ALT_NAME_TYPE_DNS = (char)0x82 , ALT_NAME_TYPE_IP = (char)0x87 }
 Certificate Generation Alternate Name Types. More...
 
enum  CertGenReturnCode : int {
  CERT_GEN_RETURN_SUCCESS = 1 , CERT_GEN_RETURN_NOT_REQUIRED = 2 , CERT_GEN_RETURN_INVALID_RANDOM = -1 , CERT_GEN_RETURN_MALLOC_ERROR = -2 ,
  CERT_GEN_RETURN_ECC_INIT_ERROR = -3 , CERT_GEN_RETURN_ECC_CREATE_ERROR = -4 , CERT_GEN_RETURN_RSA_INIT_ERROR = -5 , CERT_GEN_RETURN_RSA_CREATE_ERROR = -6 ,
  CERT_GEN_RETURN_CERT_INIT_ERROR = -7 , CERT_GEN_RETURN_CERT_CREATE_ERROR = -8 , CERT_GEN_RETURN_CERT_SIGNING_ERROR = -9 , CERT_GEN_RETURN_CERT_SAVING_ERROR = -10 ,
  CERT_GEN_RETURN_KEY_CONVERT_ERROR = -11 , CERT_GEN_RETURN_KEY_SAVING_ERROR = -12 , CERT_GEN_RETURN_SET_ISSUER_ERROR = -13
}
 Certificate Generation Function Return Codes. More...
 

Functions

CertGenReturnCode SSL_CreateNewSelfSignedCert (CertGenData &pGenData)
 Generates a new self-signed certificate that will be stored on the device.
 
void EnableOnboardCertificateCreation (CertGenReturnCode(*createCertFunc)(CertGenData &cGenData)=SSL_CreateNewSelfSignedCert)
 Enables the ability for the module to automatically generate self-signed certificates for use in SSL/TLS connections when acting as the server.
 
void FillInAltNamesASN1 (Cert &TheCert, NBString &altNameString)
 Helper function used to build ASN1 representation of alt names.
 
CertGenReturnCode CheckAndCreateHalCertAndKey ()
 Check for a valid SSL certificate and generate one if not found.
 
CertGenDataGetDataForCertGen ()
 A function to be overridden to pass certificate details to the certificate generator.
 

Detailed Description

Onboard Self-Signed Certificate Generation.