- Keep private key encrypted
- Show password field always
This commit is contained in:
Hadi Nategh 2017-08-24 18:15:40 +02:00
parent b0cd55f0b6
commit 63440ddbc5
2 changed files with 6 additions and 4 deletions

View File

@ -310,12 +310,12 @@
<row>
<description value="Certificate file in p12 format"/>
<vbox>
<file id="smimeKeyUpload" accept=".key,.p12" onchange="app.admin.et2.getWidgetById('smime_pkcs12_password').set_disabled(false);"/>
<passwd id="smime_pkcs12_password" size="32" maxlength="128" autocomplete="off" blur="Password to unlock encrypted p12" disabled="true"/>
<file id="smimeKeyUpload" accept=".p12,.pfx"/>
<passwd id="smime_pkcs12_password" size="32" maxlength="128" blur="Password to unlock encrypted p12" autocomplete="off"/>
</vbox>
</row>
<row>
<description value="Paste your private key as text here or upload your .key/.p12 file"/>
<description value="Paste your private key as text here or upload your .p12 file"/>
<textbox multiline="true" id="acc_smime_password" height="130" resize_ratio="0" class="et2_fullWidth"/>
</row>
<row>

View File

@ -158,9 +158,11 @@ class Smime extends Horde_Crypt_Smime
*/
public function extractCertPKCS12 ($pkcs12, $passphrase = '')
{
$certs = array ();
$certs = $out = array ();
if (openssl_pkcs12_read($pkcs12, $certs, $passphrase))
{
openssl_pkey_export($certs['pkey'], $out, $passphrase);
$certs['pkey'] = $out;
return $certs;
}
else