Files
piratepoet/lib/Util/DKIM.php
2015-08-10 18:37:41 -04:00

25 lines
515 B
PHP

<?php
namespace MailPoet\Util;
class DKIM {
public static function generateKeys() {
try {
$certificate = openssl_pkey_new(array('private_bits' => 1024));
$keys = array('public' => '', 'private' => '');
// get private key
openssl_pkey_export($certificate, $keys['private']);
// get public key
$details = openssl_pkey_get_details($certificate);
$keys['public'] = $details['key'];
return $keys;
} catch(Exception $e) {
return false;
}
}
}