Sample program showing how to connect GR-PEACH into Watson IoT through mbed Connector and Watson's Connector Bridge

Dependencies:   AsciiFont DisplayApp GR-PEACH_video LCD_shield_config LWIPBP3595Interface_STA_for_mbed-os USBDevice

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Authenticator.h Source File

Authenticator.h

Go to the documentation of this file.
00001 /** 
00002  * @file    Authenticator.h
00003  * @brief   mbed CoAP Endpoint Device Management Authenticator class
00004  * @author  Doug Anson
00005  * @version 1.0
00006  * @see
00007  *
00008  * Copyright (c) 2016
00009  *
00010  * Licensed under the Apache License, Version 2.0 (the "License");
00011  * you may not use this file except in compliance with the License.
00012  * You may obtain a copy of the License at
00013  *
00014  *     http://www.apache.org/licenses/LICENSE-2.0
00015  *
00016  * Unless required by applicable law or agreed to in writing, software
00017  * distributed under the License is distributed on an "AS IS" BASIS,
00018  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00019  * See the License for the specific language governing permissions and
00020  * limitations under the License.
00021  */
00022 
00023 #ifndef __DM_AUTHENTICATOR_H__
00024 #define __DM_AUTHENTICATOR_H__
00025 
00026 // Logger
00027 #include "mbed-connector-interface/Logger.h"
00028 
00029 class Authenticator {
00030     public:
00031         /**
00032         Default constructor
00033         @param logger input logger instance
00034         @param secret input secret
00035         */
00036         Authenticator(const Logger *logger,const void *secret = NULL);
00037         
00038         /**
00039         Copy constructor
00040         @param resource input the Authenticator that is to be deep copied
00041         */
00042         Authenticator(const Authenticator &manager);
00043     
00044         /**
00045         Destructor
00046         */
00047         virtual ~Authenticator();
00048         
00049         /**
00050         Set the secret
00051         @param secret input the secret
00052         */
00053         virtual void setSecret(void *secret);
00054         
00055         /**
00056         Authenticate
00057         @param challenge input the challenge to authenticate with
00058         @return true - authenciated successfully, false - otherwise
00059         */
00060         virtual bool authenticate(void *challenge); 
00061     
00062     protected:
00063         Logger  *m_logger;
00064         void    *m_secret;
00065 };
00066 
00067 #endif // __DM_AUTHENTICATOR_H__