We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i'm trying to encrypt and sign from sample code
decrypt fine but verify fail.
my code `$config = $allConf[1]; $publicKeyPath = $config->publicKeyPath; $privateKeyPath = $config->privateKeyPath; $privateKeyPassphrase = $config->privateKeyPassphrase;
$recipientPublicKey = \OpenPGP_Message::parse(\OpenPGP::unarmor(file_get_contents($publicKeyPath), 'PGP PUBLIC KEY BLOCK')); $encryptedPrivateKey = \OpenPGP_Message::parse(\OpenPGP::unarmor(file_get_contents($privateKeyPath), 'PGP PRIVATE KEY BLOCK'));
$key = OpenPGP_Crypt_Symmetric::decryptSecretKey($privateKeyPassphrase, $encryptedPrivateKey[0]);
$signer = new OpenPGP_Crypt_RSA($key); $data = new OpenPGP_LiteralDataPacket("TEST TEXT"); $signed = $signer->sign($data);
//$compressed = new OpenPGP_CompressedDataPacket($signed);
//var_dump(new OpenPGP_Message([$compressed])); exit;
$encrypted = OpenPGP_Crypt_Symmetric::encrypt([$recipientPublicKey, $key], $signed);
var_dump(OpenPGP::enarmor($encrypted->to_bytes(), 'PGP MESSAGE'));`
The text was updated successfully, but these errors were encountered:
this is command code in OPENPGP
gpg --pinentry-mode=loopback --passphrase "passphrase " --encrypt --sign -u "user_website_sign" --armor -r "user_website" "./test_file.txt"
Sorry, something went wrong.
No branches or pull requests
i'm trying to encrypt and sign from sample code
decrypt fine but verify fail.
my code
`$config = $allConf[1];
$publicKeyPath = $config->publicKeyPath;
$privateKeyPath = $config->privateKeyPath;
$privateKeyPassphrase = $config->privateKeyPassphrase;
$recipientPublicKey = \OpenPGP_Message::parse(\OpenPGP::unarmor(file_get_contents($publicKeyPath), 'PGP PUBLIC KEY BLOCK'));
$encryptedPrivateKey = \OpenPGP_Message::parse(\OpenPGP::unarmor(file_get_contents($privateKeyPath), 'PGP PRIVATE KEY BLOCK'));
$key = OpenPGP_Crypt_Symmetric::decryptSecretKey($privateKeyPassphrase, $encryptedPrivateKey[0]);
$signer = new OpenPGP_Crypt_RSA($key);
$data = new OpenPGP_LiteralDataPacket("TEST TEXT");
$signed = $signer->sign($data);
//$compressed = new OpenPGP_CompressedDataPacket($signed);
//var_dump(new OpenPGP_Message([$compressed])); exit;
$encrypted = OpenPGP_Crypt_Symmetric::encrypt([$recipientPublicKey, $key], $signed);
var_dump(OpenPGP::enarmor($encrypted->to_bytes(), 'PGP MESSAGE'));`
The text was updated successfully, but these errors were encountered: