W.I.P of SMIME support for mail application:

- Add a method for extracting public-key from a certificate
This commit is contained in:
Hadi Nategh 2017-01-23 16:19:19 +01:00
parent d8163bbbf7
commit 2b99050d99

View File

@ -69,4 +69,17 @@ class Smime extends Horde_Crypt_Smime
}
return true;
}
/**
* Extract public key from certificate
*
* @param type $cert
* @return string returns public key
*/
public function get_publickey ($cert)
{
$handle = openssl_get_publickey($cert);
$keyData = openssl_pkey_get_details($handle);
return $keyData['key'];
}
}