X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FCrypto.php;h=b2fad997003bd352a43ebda268f376478966fd16;hb=c5c60d3d050ce2630197027a4b4375c00e270d95;hp=adee8cd60e4adb6a3814318b06810aab91fabf60;hpb=a86ffd878dc3ca8638345781bda0f18071d439e5;p=friendica.git diff --git a/src/Util/Crypto.php b/src/Util/Crypto.php index adee8cd60e..b2fad99700 100644 --- a/src/Util/Crypto.php +++ b/src/Util/Crypto.php @@ -8,9 +8,6 @@ use Friendica\Core\Config; use ASN_BASE; use ASNValue; -require_once 'library/ASNValue.class.php'; -require_once 'library/asn1.php'; - /** * @brief Crypto class */ @@ -96,7 +93,7 @@ class Crypto $modulus->SetIntBuffer($Modulus); $publicExponent = new ASNValue(ASNValue::TAG_INTEGER); $publicExponent->SetIntBuffer($PublicExponent); - $keySequenceItems = array($modulus, $publicExponent); + $keySequenceItems = [$modulus, $publicExponent]; $keySequence = new ASNValue(ASNValue::TAG_SEQUENCE); $keySequence->SetSequence($keySequenceItems); //Encode bit string @@ -125,7 +122,7 @@ class Crypto $modulus->SetIntBuffer($Modulus); $publicExponent = new ASNValue(ASNValue::TAG_INTEGER); $publicExponent->SetIntBuffer($PublicExponent); - $keySequenceItems = array($modulus, $publicExponent); + $keySequenceItems = [$modulus, $publicExponent]; $keySequence = new ASNValue(ASNValue::TAG_SEQUENCE); $keySequence->SetSequence($keySequenceItems); //Encode bit string @@ -221,11 +218,11 @@ class Crypto */ public static function newKeypair($bits) { - $openssl_options = array( + $openssl_options = [ 'digest_alg' => 'sha1', 'private_key_bits' => $bits, 'encrypt_key' => false - ); + ]; $conf = Config::get('system', 'openssl_conf_file'); if ($conf) { @@ -239,7 +236,7 @@ class Crypto } // Get private key - $response = array('prvkey' => '', 'pubkey' => ''); + $response = ['prvkey' => '', 'pubkey' => '']; openssl_pkey_export($result, $response['prvkey']);