openssl: how can i get public key from modulus

前端 未结 1 799
感情败类
感情败类 2021-01-14 09:30

I generate a pair of keys using openssl:

shell> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/mike         


        
1条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-14 10:22

    You can get the public key in a more standardized format using phpseclib, a pure PHP RSA implementation. eg.

    loadKey(array('n' => $modulus, 'e' => $exponent));
    $rsa->setPublicKey();
    
    echo $rsa->getPublicKey();
    

    0 讨论(0)
提交回复
热议问题