How do you test a public/private DSA keypair?

后端 未结 11 1195
日久生厌
日久生厌 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:28

    I always compare an MD5 hash of the modulus using these commands:

    Certificate: openssl x509 -noout -modulus -in server.crt | openssl md5
    Private Key: openssl rsa -noout -modulus -in server.key | openssl md5
    CSR: openssl req -noout -modulus -in server.csr | openssl md5
    

    If the hashes match, then those two files go together.

提交回复
热议问题