\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<string,\Nette\Http\FileUpload|int|string>  $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(string  $certificate, string  $privateKey) : void

Checks a certificate and a private key

Parameters

string $certificate

Certificate

string $privateKey

Private key

Throws

\App\CloudModule\Exceptions\InvalidPrivateKeyForCertificateException

uploadCertsAndKey()

uploadCertsAndKey(string[]  $paths, string  $certificate, string  $privateKey) : void

Uploads certificate and private key

Parameters

string[] $paths

Paths for certificate and private key

string $certificate

Certificate

string $privateKey

Private key

createDirectory()

createDirectory() : void

Create a directory for certificates

Throws

\App\CloudModule\Exceptions\CannotCreateCertificateDirectoryException