diff --git a/samples/Basic_AWS/.cproject b/samples/Basic_AWS/.cproject new file mode 100644 index 0000000000..ed83788380 --- /dev/null +++ b/samples/Basic_AWS/.cproject @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + make + -f ${ProjDirPath}/Makefile + all + true + true + true + + + make + -f ${ProjDirPath}/Makefile + clean + true + true + true + + + make + -f ${ProjDirPath}/Makefile + flash + true + true + true + + + make + -f ${ProjDirPath}/Makefile + flashonefile + true + true + true + + + make + -f ${ProjDirPath}/Makefile + flashinit + true + true + true + + + make + -f ${ProjDirPath}/Makefile + flashboot + true + true + true + + + make + -f ${ProjDirPath}/Makefile + rebuild + true + true + true + + + + + + + + + + + + + + + + + + + + diff --git a/samples/Basic_AWS/.project b/samples/Basic_AWS/.project new file mode 100644 index 0000000000..685876e484 --- /dev/null +++ b/samples/Basic_AWS/.project @@ -0,0 +1,29 @@ + + + Basic_AWS + + + SmingFramework + Sming + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/samples/Basic_AWS/Makefile b/samples/Basic_AWS/Makefile new file mode 100644 index 0000000000..ff51b6c3a7 --- /dev/null +++ b/samples/Basic_AWS/Makefile @@ -0,0 +1,9 @@ +##################################################################### +#### Please don't change this file. Use component.mk instead #### +##################################################################### + +ifndef SMING_HOME +$(error SMING_HOME is not set: please configure it as an environment variable) +endif + +include $(SMING_HOME)/project.mk diff --git a/samples/Basic_AWS/README.rst b/samples/Basic_AWS/README.rst new file mode 100644 index 0000000000..42fbf3c6a7 --- /dev/null +++ b/samples/Basic_AWS/README.rst @@ -0,0 +1,8 @@ +Basic AWS +========= + +How to set up Amazon Web Services to use as an IOT gateway. + + +openssl rsa -in APP.private.key -out APP.private.key.der -outform DER +openssl x509 -in APP.cert.pem -out APP.cert.der -outform DER diff --git a/samples/Basic_AWS/app/MqttMessage.h b/samples/Basic_AWS/app/MqttMessage.h new file mode 100644 index 0000000000..370836105a --- /dev/null +++ b/samples/Basic_AWS/app/MqttMessage.h @@ -0,0 +1,38 @@ +/**** + * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development. + * Created 2015 by Skurydin Alexey + * http://github.com/SmingHub/Sming + * All files of the Sming Core are provided under the LGPL v3 license. + * + * MqttMessage.h - C++ utilities to simplify handling MQTT messages and buffers + * + ****/ + +#pragma once + +#include +#include + +/** + * @brief Helper class to simplify printing and parsing message buffers + */ +class MqttBuffer : public Printable +{ +public: + MqttBuffer(const mqtt_buffer_t& buf) : buf(buf) + { + } + + operator String() const + { + return String(reinterpret_cast(buf.data), buf.length); + } + + size_t printTo(Print& p) const override + { + return p.write(buf.data, buf.length); + } + +private: + const mqtt_buffer_t& buf; +}; diff --git a/samples/Basic_AWS/app/application.cpp b/samples/Basic_AWS/app/application.cpp new file mode 100644 index 0000000000..eb6ad38688 --- /dev/null +++ b/samples/Basic_AWS/app/application.cpp @@ -0,0 +1,101 @@ +#include +#include "MqttMessage.h" + +// If you want, you can define WiFi settings globally in Eclipse Environment Variables +#ifndef WIFI_SSID +#define WIFI_SSID "PleaseEnterSSID" // Put you SSID and Password here +#define WIFI_PWD "PleaseEnterPass" +#endif + +namespace +{ +MqttClient mqtt; + +IMPORT_FSTR(privateKeyData, PROJECT_DIR "/files/private.pem.key.der"); +IMPORT_FSTR(certificateData, PROJECT_DIR "/files/certificate.pem.crt.der"); +IMPORT_FSTR(awsEndpoint, PROJECT_DIR "/files/endpoint.txt"); + +// Run MQTT client +void startMqttClient() +{ + mqtt.setSslInitHandler([](Ssl::Session& session) { + session.options.verifyLater = true; + session.keyCert.assign(privateKeyData, certificateData); + }); + + Url url; + url.Scheme = URI_SCHEME_MQTT_SECURE; + url.Host = awsEndpoint; + mqtt.connect(url, "Basic_AWS"); + + // Assign a disconnect callback function + // mqtt.setCompleteDelegate(checkMQTTDisconnect); + mqtt.subscribe("thing/fish/test"); +} + +// Publish our message +void publishMessage() +{ + // Auto reconnect + if(mqtt.getConnectionState() != eTCS_Connected) { + startMqttClient(); + } + + Serial.println("publish message"); + mqtt.publish("version", "ver.1.2"); +} + +// Callback for messages, arrived from MQTT server +int onMessagePublish(MqttClient& client, mqtt_message_t* message) +{ + Serial.print("Publish: "); + Serial.print(MqttBuffer(message->publish.topic_name)); + Serial.print(":\r\n\t"); // Pretify alignment for printing + Serial.println(MqttBuffer(message->publish.content)); + return 0; +} + +int onMessageConnect(MqttClient& client, mqtt_message_t* message) +{ + Serial.print("Connect: "); + Serial.print(MqttBuffer(message->connect.protocol_name)); + Serial.print(", client: "); + Serial.println(MqttBuffer(message->connect.client_id)); + return 0; +} + +int onMessageDisconnect(MqttClient& client, mqtt_message_t* message) +{ + Serial.println("Disconnect"); + return 0; +} + +void gotIP(IpAddress ip, IpAddress netmask, IpAddress gateway) +{ + Serial.print("Connected: "); + Serial.println(ip); + startMqttClient(); + publishMessage(); // run once publishMessage + + mqtt.subscribe("$aws/things/Basic_AWS/shadow/get"); +} + +} // namespace + +void init() +{ + Serial.begin(SERIAL_BAUD_RATE); // 115200 by default + Serial.systemDebugOutput(true); + + Serial.println("Hello"); + + // initialization config + mqtt.setEventHandler(MQTT_TYPE_PUBLISH, onMessagePublish); + mqtt.setEventHandler(MQTT_TYPE_CONNECT, onMessageConnect); + mqtt.setEventHandler(MQTT_TYPE_DISCONNECT, onMessageDisconnect); + + WifiStation.config(WIFI_SSID, WIFI_PWD); + WifiStation.enable(true); + WifiEvents.onStationGotIP(gotIP); + WifiAccessPoint.enable(false); +} diff --git a/samples/Basic_AWS/component.mk b/samples/Basic_AWS/component.mk new file mode 100644 index 0000000000..bcb042181f --- /dev/null +++ b/samples/Basic_AWS/component.mk @@ -0,0 +1,4 @@ +DISABLE_SPIFFS := 1 +ENABLE_SSL := 1 +MQTT_NO_COMPAT := 1 +ENABLE_CUSTOM_HEAP := 1 diff --git a/samples/Basic_AWS/files/3051d5b002-certificate.pem.crt.txt b/samples/Basic_AWS/files/3051d5b002-certificate.pem.crt.txt new file mode 100644 index 0000000000..cc3928d8b7 --- /dev/null +++ b/samples/Basic_AWS/files/3051d5b002-certificate.pem.crt.txt @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDWjCCAkKgAwIBAgIVAOxaW1RB41mdhMvpNLw9Bo85VGkRMA0GCSqGSIb3DQEB +CwUAME0xSzBJBgNVBAsMQkFtYXpvbiBXZWIgU2VydmljZXMgTz1BbWF6b24uY29t +IEluYy4gTD1TZWF0dGxlIFNUPVdhc2hpbmd0b24gQz1VUzAeFw0xOTA5MTUxNDI3 +MjVaFw00OTEyMzEyMzU5NTlaMB4xHDAaBgNVBAMME0FXUyBJb1QgQ2VydGlmaWNh +dGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQClilQHo7KeM6hv61Zi +Up2274y5/fOzoYYznCr/+8fivmtAh6BBekiFY5FYPOr1Gb6hIQs0TQvmOeYWDD4n +dy2qHhSnhWVyw/OzCr9QngBVjNQ7PVDd+Ij708E3UEuZp9/ORiGfSPQ/LrYFw6bB +zlPgRiN7H6hNOrmG1+lsZCwH/zFkGaOMZp22pUTUmNX//Fg9mni0OT4iBngD/lVO ++TIBz96Nj0kQepr5Pci4nwuAwrxf+sBy8s8aA6JxJrB1zlUMT0rc7K4AxjJCVi9q +am/Fd7Lyh+4JD0ndPVsIIpUKD7JDSCmicOA0q3VB1p4SuDGrsgvvqQXrfncSnBTw +tEnnAgMBAAGjYDBeMB8GA1UdIwQYMBaAFI08RqEu1VXBTz7eQypWXKpuZV6OMB0G +A1UdDgQWBBQ9AwSFdv0tkOROoUjIPOX66boY9zAMBgNVHRMBAf8EAjAAMA4GA1Ud +DwEB/wQEAwIHgDANBgkqhkiG9w0BAQsFAAOCAQEAfeoF/tH7cI6cw9psDGi3LEyQ +YRuut9f6psjY4j++DrWGpsqvLlghvgeighvbSf0J6CTHVlrUXpQEOgRk3HzcMjwW +7EczkT6FsJghqjGgye3wKtAsqoide8uvC1mJ7Ev02LfdEZDge55+930ozBzXnjH2 +R1s0pRokzh8pHy2Ug/Y/29dRBPK9smCtOFUAeQpJ6Z93u720bOUOqHo+KBfZjTEC +5eyxp2NiuzYP8bCOEyJIcDXXk5xVy6WZMJ73Xj/2z5M39YIr+QXvITDx4zfTK8Ue +3h9I7CULHEA2cjKmdlDiNGTu2fKChrqgUy0owzQSPxf1G9gV95yESLEceIpKjg== +-----END CERTIFICATE----- diff --git a/samples/Basic_AWS/files/3051d5b002-private.pem.key b/samples/Basic_AWS/files/3051d5b002-private.pem.key new file mode 100644 index 0000000000..e265bf1f02 --- /dev/null +++ b/samples/Basic_AWS/files/3051d5b002-private.pem.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEApYpUB6OynjOob+tWYlKdtu+Muf3zs6GGM5wq//vH4r5rQIeg +QXpIhWORWDzq9Rm+oSELNE0L5jnmFgw+J3ctqh4Up4VlcsPzswq/UJ4AVYzUOz1Q +3fiI+9PBN1BLmaffzkYhn0j0Py62BcOmwc5T4EYjex+oTTq5htfpbGQsB/8xZBmj +jGadtqVE1JjV//xYPZp4tDk+IgZ4A/5VTvkyAc/ejY9JEHqa+T3IuJ8LgMK8X/rA +cvLPGgOicSawdc5VDE9K3OyuAMYyQlYvampvxXey8ofuCQ9J3T1bCCKVCg+yQ0gp +onDgNKt1QdaeErgxq7IL76kF6353EpwU8LRJ5wIDAQABAoIBABp78Aes2+XNk/Qb +7Z0bZJog5x3WkEe73tGg+YwsxwTyvAv95tiy7KlSja1VSa3e6Y2z0KwUa4Pw3WvH +l6YOviKKX3mRsPJUgUeyv3rxXFJTjpzPqYFpwtivPylPUlkJ75d7xuNJ87GsEnkH +nUVCck7eSczn+rA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NZ+xjxA2LQOQ== +-----END RSA PRIVATE KEY----- diff --git a/samples/Basic_AWS/files/3051d5b002-public.pem.key b/samples/Basic_AWS/files/3051d5b002-public.pem.key new file mode 100644 index 0000000000..b44d32683f --- /dev/null +++ b/samples/Basic_AWS/files/3051d5b002-public.pem.key @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApYpUB6OynjOob+tWYlKd +tu+Muf3zs6GGM5wq//vH4r5rQIegQXpIhWORWDzq9Rm+oSELNE0L5jnmFgw+J3ct +qh4Up4VlcsPzswq/UJ4AVYzUOz1Q3fiI+9PBN1BLmaffzkYhn0j0Py62BcOmwc5T +4EYjex+oTTq5htfpbGQsB/8xZBmjjGadtqVE1JjV//xYPZp4tDk+IgZ4A/5VTvky +Ac/ejY9JEHqa+T3IuJ8LgMK8X/rAcvLPGgOicSawdc5VDE9K3OyuAMYyQlYvampv +xXey8ofuCQ9J3T1bCCKVCg+yQ0gponDgNKt1QdaeErgxq7IL76kF6353EpwU8LRJ +5wIDAQAB +-----END PUBLIC KEY----- diff --git a/samples/Basic_AWS/files/AmazonRootCA1.pem b/samples/Basic_AWS/files/AmazonRootCA1.pem new file mode 100644 index 0000000000..a6f3e92af5 --- /dev/null +++ b/samples/Basic_AWS/files/AmazonRootCA1.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF +ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6 +b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL +MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv +b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj +ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM +9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw +IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6 +VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L +93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm +jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA +A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI +U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs +N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv +o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU +5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy +rqXRfboQnoZsG4q5WTP468SQvvG5 +-----END CERTIFICATE----- diff --git a/samples/Basic_AWS/files/AmazonRootCA1.pem.der b/samples/Basic_AWS/files/AmazonRootCA1.pem.der new file mode 100644 index 0000000000..86b7dcd0b4 Binary files /dev/null and b/samples/Basic_AWS/files/AmazonRootCA1.pem.der differ diff --git a/samples/Basic_AWS/files/certificate.pem.crt.der b/samples/Basic_AWS/files/certificate.pem.crt.der new file mode 100644 index 0000000000..172a81abf7 Binary files /dev/null and b/samples/Basic_AWS/files/certificate.pem.crt.der differ diff --git a/samples/Basic_AWS/files/endpoint.txt b/samples/Basic_AWS/files/endpoint.txt new file mode 100644 index 0000000000..d12d36a653 --- /dev/null +++ b/samples/Basic_AWS/files/endpoint.txt @@ -0,0 +1 @@ +a2e224ln0t7m96-ats.iot.eu-west-1.amazonaws.com \ No newline at end of file diff --git a/samples/Basic_AWS/files/private.pem.key.der b/samples/Basic_AWS/files/private.pem.key.der new file mode 100644 index 0000000000..fb614a79b3 Binary files /dev/null and b/samples/Basic_AWS/files/private.pem.key.der differ diff --git a/samples/Basic_AWS/include/ssl/cert.h b/samples/Basic_AWS/include/ssl/cert.h new file mode 100644 index 0000000000..b0569a1e1c --- /dev/null +++ b/samples/Basic_AWS/include/ssl/cert.h @@ -0,0 +1,27 @@ +unsigned char default_certificate[] = { + 0x30, 0x82, 0x01, 0xd7, 0x30, 0x82, 0x01, 0x40, 0x02, 0x09, 0x00, 0xf2, 0x26, 0x4c, 0x02, 0x27, 0x42, 0x08, 0x09, + 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x34, 0x31, 0x32, + 0x30, 0x30, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x29, 0x61, 0x78, 0x54, 0x4c, 0x53, 0x20, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x20, 0x44, 0x6f, 0x64, 0x67, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, 0x30, + 0x39, 0x31, 0x34, 0x32, 0x30, 0x35, 0x32, 0x33, 0x36, 0x5a, 0x17, 0x0d, 0x33, 0x33, 0x30, 0x35, 0x32, 0x33, 0x32, + 0x30, 0x35, 0x32, 0x33, 0x36, 0x5a, 0x30, 0x2c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0d, + 0x61, 0x78, 0x54, 0x4c, 0x53, 0x20, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, + 0x55, 0x04, 0x03, 0x13, 0x09, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x81, 0x9f, 0x30, 0x0d, + 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, + 0x89, 0x02, 0x81, 0x81, 0x00, 0xb8, 0x03, 0x9f, 0xa7, 0x44, 0x83, 0xc9, 0x3d, 0x6d, 0xd3, 0x77, 0x93, 0x83, 0x54, + 0xed, 0x2e, 0xd6, 0xc3, 0xfb, 0xdf, 0xe3, 0x4d, 0x53, 0x0f, 0x26, 0x06, 0xb0, 0xb9, 0xc8, 0x8e, 0x7a, 0x38, 0x18, + 0x89, 0x2e, 0xe3, 0xa3, 0x53, 0xc2, 0xba, 0xe5, 0x3f, 0xa5, 0x25, 0x54, 0x8a, 0x67, 0x09, 0xf1, 0x9f, 0xf2, 0xad, + 0x2e, 0x42, 0xb7, 0x8d, 0x2c, 0x0b, 0x73, 0xf6, 0x5a, 0x89, 0x51, 0xac, 0xf0, 0x97, 0x77, 0x17, 0x4d, 0x66, 0xca, + 0x20, 0xc9, 0x17, 0xbf, 0x97, 0xd3, 0xfd, 0xf0, 0xf7, 0x4b, 0xad, 0x30, 0xa9, 0x09, 0x3c, 0x62, 0x85, 0xde, 0x47, + 0x60, 0x10, 0x2d, 0xe5, 0x0b, 0x9e, 0x50, 0x44, 0xb3, 0x99, 0xda, 0x51, 0xd4, 0xbe, 0x30, 0x4f, 0x6d, 0x9d, 0x23, + 0x49, 0x47, 0x4e, 0xe7, 0xcf, 0x2f, 0x1b, 0x5b, 0xa0, 0x49, 0xc0, 0xc2, 0x51, 0x35, 0xde, 0x61, 0x82, 0x35, 0xc1, + 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, + 0x00, 0x03, 0x81, 0x81, 0x00, 0x20, 0x37, 0xa2, 0xc0, 0xd5, 0x9c, 0x8d, 0xd0, 0x6f, 0x9d, 0x39, 0x2c, 0xb1, 0xb6, + 0xd7, 0x25, 0xc1, 0x92, 0xf3, 0x6d, 0x44, 0xad, 0x89, 0x33, 0xa4, 0xcb, 0xde, 0xc0, 0xeb, 0x58, 0xcb, 0xa2, 0xd5, + 0xc7, 0x54, 0xac, 0x8a, 0x29, 0xfd, 0x8e, 0x4e, 0x0e, 0x2a, 0x09, 0xec, 0xae, 0x3d, 0x40, 0xd0, 0x4c, 0xd0, 0xd6, + 0xa5, 0x8a, 0x97, 0x40, 0x92, 0x6b, 0x51, 0xc1, 0xf5, 0xe9, 0xa8, 0xdc, 0x99, 0xac, 0x35, 0xae, 0x59, 0x1f, 0x14, + 0x4d, 0x7e, 0xbb, 0xa7, 0x31, 0x76, 0x8c, 0xf3, 0xfc, 0xf8, 0x91, 0x91, 0x3d, 0x6b, 0x15, 0xec, 0xdd, 0x04, 0xb4, + 0x67, 0x81, 0xee, 0xd8, 0x31, 0xaf, 0xfc, 0xf2, 0x6a, 0x36, 0x87, 0xc1, 0x03, 0x49, 0xc4, 0x64, 0x17, 0x29, 0x8b, + 0x44, 0x50, 0x78, 0x3a, 0x2a, 0x0b, 0x6b, 0xf5, 0xf5, 0x38, 0x87, 0x4e, 0x86, 0x68, 0x3b, 0x7d, 0xae, 0x1f, 0xd7}; +unsigned int default_certificate_len = 475; diff --git a/samples/Basic_AWS/include/ssl/private_key.h b/samples/Basic_AWS/include/ssl/private_key.h new file mode 100644 index 0000000000..1e8c08d258 --- /dev/null +++ b/samples/Basic_AWS/include/ssl/private_key.h @@ -0,0 +1,34 @@ +unsigned char default_private_key[] = { + 0x30, 0x82, 0x02, 0x5c, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xb8, 0x03, 0x9f, 0xa7, 0x44, 0x83, 0xc9, 0x3d, + 0x6d, 0xd3, 0x77, 0x93, 0x83, 0x54, 0xed, 0x2e, 0xd6, 0xc3, 0xfb, 0xdf, 0xe3, 0x4d, 0x53, 0x0f, 0x26, 0x06, 0xb0, + 0xb9, 0xc8, 0x8e, 0x7a, 0x38, 0x18, 0x89, 0x2e, 0xe3, 0xa3, 0x53, 0xc2, 0xba, 0xe5, 0x3f, 0xa5, 0x25, 0x54, 0x8a, + 0x67, 0x09, 0xf1, 0x9f, 0xf2, 0xad, 0x2e, 0x42, 0xb7, 0x8d, 0x2c, 0x0b, 0x73, 0xf6, 0x5a, 0x89, 0x51, 0xac, 0xf0, + 0x97, 0x77, 0x17, 0x4d, 0x66, 0xca, 0x20, 0xc9, 0x17, 0xbf, 0x97, 0xd3, 0xfd, 0xf0, 0xf7, 0x4b, 0xad, 0x30, 0xa9, + 0x09, 0x3c, 0x62, 0x85, 0xde, 0x47, 0x60, 0x10, 0x2d, 0xe5, 0x0b, 0x9e, 0x50, 0x44, 0xb3, 0x99, 0xda, 0x51, 0xd4, + 0xbe, 0x30, 0x4f, 0x6d, 0x9d, 0x23, 0x49, 0x47, 0x4e, 0xe7, 0xcf, 0x2f, 0x1b, 0x5b, 0xa0, 0x49, 0xc0, 0xc2, 0x51, + 0x35, 0xde, 0x61, 0x82, 0x35, 0xc1, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x81, 0x80, 0x18, 0xfb, 0xd4, 0xf7, 0x5e, + 0xe4, 0x0d, 0xb4, 0x9b, 0x6e, 0xb4, 0xb3, 0x80, 0x87, 0x4d, 0x54, 0xa8, 0xb0, 0x1f, 0x48, 0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 0x15, 0x1c, 0x70, 0x26, 0x4f, 0x67, 0x11, 0x02, 0x40, 0x02, 0x54, 0x5d, 0x63, 0x2c, 0x2c, 0x7c, + 0x4c, 0x09, 0x18, 0x38, 0xac, 0x0a, 0xec, 0xb7, 0x33, 0x86, 0x15, 0x23, 0x39, 0xab, 0x50, 0x22, 0x6f, 0x7a, 0x71, + 0xa8, 0x46, 0x13, 0x0f, 0xae, 0xb4, 0xa4, 0xc4, 0x63, 0x03, 0x35, 0x05, 0x51, 0x0b, 0x59, 0x8b, 0xcf, 0x60, 0xf2, + 0xa2, 0x15, 0xaf, 0x7e, 0x07, 0xb2, 0xb5, 0xc6, 0x08, 0x75, 0x84, 0xed, 0x58, 0xf0, 0xb7, 0x37, 0xa0, 0xcd, 0x21}; +unsigned int default_private_key_len = 608;