\App\CloudModule\ModelsAwsManager

Tool for managing Amazon AWS IoT

Summary

Methods
Properties
Constants
__construct()
createMqttInterface()
createPaths()
downloadCaCertificate()
checkCertificate()
uploadCertsAndKey()
No public properties found
CA_FILENAME
No protected methods found
No protected properties found
N/A
createDirectory()
$configManager
$certManager
$certPath
$client
N/A

Constants

CA_FILENAME

CA_FILENAME = 'aws-ca.crt' : 

CA certificate filename

Properties

$configManager

$configManager : \App\ConfigModule\Models\GenericManager

Type

normal — Generic configuration manager

$certManager

$certManager : \App\CoreModule\Models\CertificateManager

Type

normal — manager for certificates

$certPath

$certPath : string

Type

normal — Path to the certificates

$client

$client : \GuzzleHttp\ClientInterface

Type

\GuzzleHttp\ClientInterface — HTTP(S) client

Methods

__construct()

__construct(string  $certPath, \App\CoreModule\Models\CertificateManager  $certManager, \App\ConfigModule\Models\GenericManager  $configManager, \GuzzleHttp\ClientInterface  $client) : mixed

Constructor

Parameters

string $certPath

Path to the certificates

\App\CoreModule\Models\CertificateManager $certManager

Manager for certificates

\App\ConfigModule\Models\GenericManager $configManager

Generic config manager

\GuzzleHttp\ClientInterface $client

HTTP(S) client

Returns

mixed

createMqttInterface()

createMqttInterface(array  $values) : void

Creates a new MQTT interface

Parameters

array $values

Values from form

Throws

\GuzzleHttp\Exception\GuzzleException
\App\CloudModule\Exceptions\InvalidPrivateKeyForCertificateException
\Nette\Utils\JsonException

createPaths()

createPaths() : string[]

Creates paths for root CA certificate, certificate and private key

Returns

string[] —

Paths for root CA certificate, certificate and private key

downloadCaCertificate()

downloadCaCertificate() : void

Downloads the root CA certificate

Throws

\GuzzleHttp\Exception\GuzzleException
\Nette\IOException

checkCertificate()

checkCertificate(array  $values) : void

Checks a certificate and a private key

Parameters

array $values

Form values

Throws

\App\CloudModule\Exceptions\InvalidPrivateKeyForCertificateException

uploadCertsAndKey()

uploadCertsAndKey(array  $values, string[]  $paths) : void

Uploads root CA certificate, certificate and private key

Parameters

array $values

Form values

string[] $paths

Paths for root CA certificate, certificate and private key

createDirectory()

createDirectory() : void

Create a directory for certificates

Throws

\App\CloudModule\Exceptions\CannotCreateCertificateDirectoryException