How do you test a public/private DSA keypair?

后端 未结 11 1187
日久生厌
日久生厌 2020-12-12 08:35

Is there an easy way to verify that a given private key matches a given public key? I have a few *.puband a few *.key files, and I need to check w

11条回答
  •  庸人自扰
    2020-12-12 09:16

    For DSA keys, use

     openssl dsa -pubin -in dsa.pub -modulus -noout
    

    to print the public keys, then

     openssl dsa -in dsa.key -modulus -noout
    

    to display the public keys corresponding to a private key, then compare them.

提交回复
热议问题