PHP code example of exonet / securemessage

1. Go to this page and download the library: Download exonet/securemessage library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

exonet / securemessage example snippets


// Create the factory.
$secureMessageFactory = new Exonet\SecureMessage\Factory();
// Set the (application wide) meta key. This key must be exactly 10 characters long.
$secureMessageFactory->setMetaKey('djuyteb765');

// Create a new SecureMessage. Note: it is not encrypted yet! 
$secureMessage = $secureMessageFactory->make('Hello, world!');
// Encrypt the Secure Message.
$encryptedMessage = $secureMessage->encrypt();

$secureMessage = $secureMessageFactory->makeFile('/path/to/report.pdf');
$encryptedMessage = $secureMessage->encrypt();