"digest_alg" => "sha1", "private_key_bits" => 2048, "private_key_type" => OPENSSL_KEYTYPE_RSA, "encrypt_key" => false ); // Create the keypair $res=openssl_pkey_new(); // Get private key openssl_pkey_export($res, $privatekey); "countryName"=>"PL", "stateOrProvinceName" => "zachodniopomorskie", "organizationName" => "company ltd", "commonName"=>"test.pl", "emailAddress"=>"test@test.pl"), $privatekey, $config); openssl_csr_export($csr, $out);
niestety w wyniku tego działania otrzymuje puste dane... tak samo jak wykonam inny skrypt, który notabene jest wprost z Manuala PHP:
$dn = array("countryName" => 'XX', "stateOrProvinceName" => 'State', "localityName" => 'SomewhereCity', "organizationName" =>'MySelf', "organizationalUnitName" => 'Whatever', "commonName" => 'mySelf', "emailAddress" => 'user@example.com'); $privkeypass = 'TrudneHaslo'; $numberofdays = 365; //RSA encryption and 1024 bits length $privkey = openssl_pkey_new(array('private_key_bits' => 1024,'private_key_type' => OPENSSL_KEYTYPE_RSA)); $csr = openssl_csr_new($dn, $privkey); $sscert = openssl_csr_sign($csr, null, $privkey, $numberofdays); openssl_x509_export($sscert, $publickey); openssl_pkey_export($privkey, $privatekey, $privkeypass); openssl_csr_export($csr, $csrStr); //Generated keys are stored into files
Otrzymuję w puste Pliki... moje pytanie - o co kaman? Czy ja na serwerze nie mam OPENSSL ? Czy mam, ale np. nie mam uprawnień do generowania certyfikatów ? Proszę o pomoc.