mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
S/MIME import from signature use BEGIN PKCS7
This commit is contained in:
parent
20daa1ce13
commit
97b65465e2
2 changed files with 15 additions and 2 deletions
|
|
@ -142,7 +142,7 @@ trait SMime
|
||||||
$sBody = \trim($sBody);
|
$sBody = \trim($sBody);
|
||||||
$certificates = [];
|
$certificates = [];
|
||||||
\openssl_pkcs7_read(
|
\openssl_pkcs7_read(
|
||||||
"-----BEGIN CERTIFICATE-----\n\n{$sBody}\n-----END CERTIFICATE-----",
|
"-----BEGIN PKCS7-----\n\n{$sBody}\n-----END PKCS7-----",
|
||||||
$certificates
|
$certificates
|
||||||
) || \error_log("OpenSSL openssl_pkcs7_read: " . \openssl_error_string());
|
) || \error_log("OpenSSL openssl_pkcs7_read: " . \openssl_error_string());
|
||||||
foreach ($certificates as $certificate) {
|
foreach ($certificates as $certificate) {
|
||||||
|
|
@ -179,7 +179,7 @@ trait SMime
|
||||||
$sBody = \trim($sBody);
|
$sBody = \trim($sBody);
|
||||||
$certificates = [];
|
$certificates = [];
|
||||||
\openssl_pkcs7_read(
|
\openssl_pkcs7_read(
|
||||||
"-----BEGIN CERTIFICATE-----\n\n{$sBody}\n-----END CERTIFICATE-----",
|
"-----BEGIN PKCS7-----\n\n{$sBody}\n-----END PKCS7-----",
|
||||||
$certificates
|
$certificates
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,19 @@ class OpenSSL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
public function asn1parse(/*string|Temporary* / $input) : ?string
|
||||||
|
{
|
||||||
|
if (\is_string($input)) {
|
||||||
|
$tmp = new Temporary('smimein-');
|
||||||
|
if (!$tmp->putContents($input)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$input = $tmp;
|
||||||
|
}
|
||||||
|
`openssl asn1parse -in $input->filename()`
|
||||||
|
}
|
||||||
|
*/
|
||||||
public function decrypt(/*string|Temporary*/ $input) : ?string
|
public function decrypt(/*string|Temporary*/ $input) : ?string
|
||||||
{
|
{
|
||||||
if (\is_string($input)) {
|
if (\is_string($input)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue