mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 02:39:46 +02:00
Added vendor directory to source control
This commit is contained in:
parent
16534d4217
commit
d2589e176f
3049 changed files with 249997 additions and 395005 deletions
|
@ -1,21 +1,21 @@
|
|||
<?php
|
||||
@include_once dirname(__FILE__).'/../vendor/autoload.php';
|
||||
require_once dirname(__FILE__).'/../lib/openpgp.php';
|
||||
require_once dirname(__FILE__).'/../lib/openpgp_crypt_rsa.php';
|
||||
|
||||
$recipientPublicKey = OpenPGP_Message::parse(OpenPGP::unarmor(file_get_contents('public.asc'), 'PGP PUBLIC KEY BLOCK'));
|
||||
|
||||
$encryptedPrivateKey = OpenPGP_Message::parse(OpenPGP::unarmor(file_get_contents('sekret.asc'), 'PGP PRIVATE KEY BLOCK'));
|
||||
$privateKeyPassphrase = 'test';
|
||||
$key = OpenPGP_Crypt_Symmetric::decryptSecretKey($privateKeyPassphrase, $encryptedPrivateKey[0]);
|
||||
|
||||
$signer = new OpenPGP_Crypt_RSA($key);
|
||||
$data = new OpenPGP_LiteralDataPacket("some text\n", ['format' => 'u']);
|
||||
$signed = $signer->sign($data);
|
||||
|
||||
$compressed = new OpenPGP_CompressedDataPacket($signed);
|
||||
$encrypted = OpenPGP_Crypt_Symmetric::encrypt([$recipientPublicKey, $key], new OpenPGP_Message([$compressed]));
|
||||
|
||||
echo OpenPGP::enarmor($encrypted->to_bytes(), 'PGP MESSAGE');
|
||||
|
||||
|
||||
<?php
|
||||
@include_once dirname(__FILE__).'/../vendor/autoload.php';
|
||||
require_once dirname(__FILE__).'/../lib/openpgp.php';
|
||||
require_once dirname(__FILE__).'/../lib/openpgp_crypt_rsa.php';
|
||||
|
||||
$recipientPublicKey = OpenPGP_Message::parse(OpenPGP::unarmor(file_get_contents('public.asc'), 'PGP PUBLIC KEY BLOCK'));
|
||||
|
||||
$encryptedPrivateKey = OpenPGP_Message::parse(OpenPGP::unarmor(file_get_contents('sekret.asc'), 'PGP PRIVATE KEY BLOCK'));
|
||||
$privateKeyPassphrase = 'test';
|
||||
$key = OpenPGP_Crypt_Symmetric::decryptSecretKey($privateKeyPassphrase, $encryptedPrivateKey[0]);
|
||||
|
||||
$signer = new OpenPGP_Crypt_RSA($key);
|
||||
$data = new OpenPGP_LiteralDataPacket("some text\n", ['format' => 'u']);
|
||||
$signed = $signer->sign($data);
|
||||
|
||||
$compressed = new OpenPGP_CompressedDataPacket($signed);
|
||||
$encrypted = OpenPGP_Crypt_Symmetric::encrypt([$recipientPublicKey, $key], new OpenPGP_Message([$compressed]));
|
||||
|
||||
echo OpenPGP::enarmor($encrypted->to_bytes(), 'PGP MESSAGE');
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue