Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. $config = array(
  2. "digest_alg" => "sha512",
  3. "private_key_bits" => 4096,
  4. "private_key_type" => OPENSSL_KEYTYPE_RSA,
  5. );
  6.  
  7. // Create the private and public key
  8. $res = openssl_pkey_new($config);
  9.  
  10. // Extract the private key from $res to $privKey
  11. openssl_pkey_export($res, $privKey);
  12.  
  13. // Extract the public key from $res to $pubKey
  14. $pubKey = openssl_pkey_get_details($res);
  15. $pubKey = $pubKey["key"];
  16.  
  17. $javni = $pubKey ;
  18. $privatni = $privKey ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement