mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-07 17:08:48 +00:00
[securemail] Update Composer dependencies
- Update phpseclib/phpseclib to version 2.0.4 - Update singpolyma/openpgp-php to version 0.3.0
This commit is contained in:
parent
37dd8a938b
commit
af672ecd1b
161 changed files with 13940 additions and 7678 deletions
31
securemail/vendor/singpolyma/openpgp-php/examples/keygen.php
vendored
Normal file
31
securemail/vendor/singpolyma/openpgp-php/examples/keygen.php
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__FILE__).'/../lib/openpgp.php';
|
||||
require_once dirname(__FILE__).'/../lib/openpgp_crypt_rsa.php';
|
||||
|
||||
$rsa = new \phpseclib\Crypt\RSA();
|
||||
$k = $rsa->createKey(512);
|
||||
$rsa->loadKey($k['privatekey']);
|
||||
|
||||
$nkey = new OpenPGP_SecretKeyPacket(array(
|
||||
'n' => $rsa->modulus->toBytes(),
|
||||
'e' => $rsa->publicExponent->toBytes(),
|
||||
'd' => $rsa->exponent->toBytes(),
|
||||
'p' => $rsa->primes[2]->toBytes(),
|
||||
'q' => $rsa->primes[1]->toBytes(),
|
||||
'u' => $rsa->coefficients[2]->toBytes()
|
||||
));
|
||||
|
||||
$uid = new OpenPGP_UserIDPacket('Test <test@example.com>');
|
||||
|
||||
$wkey = new OpenPGP_Crypt_RSA($nkey);
|
||||
$m = $wkey->sign_key_userid(array($nkey, $uid));
|
||||
|
||||
// Serialize private key
|
||||
print $m->to_bytes();
|
||||
|
||||
// Serialize public key message
|
||||
$pubm = clone($m);
|
||||
$pubm[0] = new OpenPGP_PublicKeyPacket($pubm[0]);
|
||||
|
||||
$public_bytes = $pubm->to_bytes();
|
Loading…
Add table
Add a link
Reference in a new issue