PHP code example of lifeofguenter / php-gpg-keyinfo

1. Go to this page and download the library: Download lifeofguenter/php-gpg-keyinfo 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/ */

    

lifeofguenter / php-gpg-keyinfo example snippets




use NINEJKH\GPGkeyinfo\Parser;

$parser = new Parser(file_get_contents(__DIR__ . '/example.txt'));

foreach ($parser as $keyinfo) {
    var_dump($keyinfo);

    foreach ($keyinfo as $record) {
        if ($record->hasCapabilities()) {
            var_dump($record->canEncrypt());
        }
    }
}