define key size in constructor, otherwise the key size will depend on the servers openssl conf

This commit is contained in:
Björn Schießle 2013-03-04 15:33:38 +01:00
parent 0bc7d3bcf8
commit e65e6a12f1
1 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ class Crypt {
*/
public static function createKeypair() {
$res = openssl_pkey_new();
$res = openssl_pkey_new(array('private_key_bits' => 4096));
// Get private key
openssl_pkey_export( $res, $privateKey );
@ -450,7 +450,7 @@ class Crypt {
* @returns encrypted file
*/
public static function keyEncrypt( $plainContent, $publicKey ) {
openssl_public_encrypt( $plainContent, $encryptedContent, $publicKey );
return $encryptedContent;