This is a fork of the mbed port of axTLS

Dependents:   TLS_axTLS-Example HTTPSClientExample

Embed: (wiki syntax)

« Back to documentation index

CertificateManager Class Reference

CertificateManager Class Reference

This class is in charge of loading and storing certificates. More...

#include <CertificateManager.h>

Static Public Member Functions

static void add (const char *fileName)
 Add a certificate to load.
static bool load (const bool precompute=false)
 Load certificates.
static void clear ()
 Clear everything.

Detailed Description

This class is in charge of loading and storing certificates.

Example:

    #include "mbed.h"
    #include "CertificateManager.h
    LocalFileSystem local("/local/");

    int main(void)
    {
        CertificateManager::add("/local/root.der");
        if(!CertificateManager::load())
            printf("Error while loading certificates\n");

        return 0;
    }

Definition at line 30 of file CertificateManager.h.


Member Function Documentation

void add ( const char *  fileName ) [static]

Add a certificate to load.

Parameters:
fileNameCertificate's filename.
Note:
This function does not load the certificate and does not check if the file exists.

Definition at line 24 of file CertificateManager.cpp.

void clear (  ) [static]

Clear everything.

Note:
This function should be called once a TLS connection is established with success.

Definition at line 221 of file CertificateManager.cpp.

bool load ( const bool  precompute = false ) [static]

Load certificates.

Parameters:
precomputeTells the certificate manager how to load certificates.
Returns:
True if certificates were loaded with success, false otherwise.
Note:
If the loading fails, everything is cleared. So, you have to add again all certificates you need.

Definition at line 29 of file CertificateManager.cpp.