How is public key obtained when creating new CSR with openssl using only private key?

StackOverflow https://stackoverflow.com/questions/21739557

  •  10-10-2022
  •  | 
  •  

문제

First I create private key with openssl:

openssl genrsa -des3 -out private.key 1024

So I have now private key with passphrase and now create CSR:

openssl req -new -key private.key -out CSR.csr

However when I display content of this CSR then there is included public key:

    Subject Public Key Info:
        Public Key Algorithm: rsaEncryption
            Public-Key: (1024 bit)
            Modulus:

Where this public key come from if I provided only private key?

도움이 되었습니까?

해결책

Where this public key come from if I provided only private key?

For RSA, the private key is {n,e,d}. n is the modulus, e is the public exponent, and d is the private exponent.

There are some additional parameters that can be used to speed up RSA operations, such as dp and dq, but they aren't strictly needed. And they should be kept private.

For RSA, the public key is {n,e}. So the values are always available if you have the private key. n is the modulus and e is the public exponent as with the private key.

If you somehow manage to lose e, you can often recover it because its often a well known value such as 3, 17, or 65537. If you lose d, you'll have factor n to recover it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top