How do you test a public/private DSA keypair?

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

    Encrypt something with the public key, and see which private key decrypts it.

    This Code Project article by none other than Jeff Atwood implements a simplified wrapper around the .NET cryptography classes. Assuming these keys were created for use with RSA, use the asymmetric class with your public key to encrypt, and the same with your private key to decrypt.

提交回复
热议问题