hoho Posted July 27, 2012 Report Share Posted July 27, 2012 Man vajag ar php uzģenerēt privāto un publisko atslēgu. Oriģināls sākās ar "-----BEGIN RSA PRIVATE KEY-----", bet man visu laiku sanāk "-----BEGIN PUBLIC KEY----- ". Es mēģinu sekojoši: // generate keys pair $v_config = array('private_key_bits' => 1024,'private_key_type' => OPENSSL_KEYTYPE_RSA); $v_keys = openssl_pkey_new($v_config); // get private key openssl_pkey_export($v_keys, $v_private); // get public key $v_public = openssl_pkey_get_details($v_keys); $v_public = $v_public['key']; $File = $cert_path."private_key.pem"; $Handle = fopen($File, 'w'); Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted July 27, 2012 Report Share Posted July 27, 2012 pagaidām neredzu nevinu vietu, kur kaut ko saglabātu kādā failā. pēc tā koda beigās $v_public būtu jāsatur "---BEGIN PUBLIC KEY---" un $v_private būtu jāsatur "---BEGIN RSA PRIVATE KEY---". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.