matching keys - Openssl

This is a discussion on matching keys - Openssl ; I'm attempting to write a C function to match a private key to either it's corresponding public key or certificate for both RSA and DSA algorithms. At this point, I have the keys loaded into their corresponding RSA and DSA ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: matching keys

  1. matching keys

    I'm attempting to write a C function to match a private key to either it's
    corresponding public key or certificate for both RSA and DSA algorithms. At
    this point, I have the keys loaded into their corresponding RSA and DSA
    structures. From here, what parameter checks are necesary to verify that the
    corresponding keys match? I'm guessing rsa->n would suffice for RSA, would
    dsa->p and dsa->q be an appropriate choice?

    Thanks!

    Brian


  2. Re: matching keys

    Brian Smith wrote:
    > I'm attempting to write a C function to match a private key to either
    > it's corresponding public key or certificate for both RSA and DSA
    > algorithms. At this point, I have the keys loaded into their
    > corresponding RSA and DSA structures. From here, what parameter checks
    > are necesary to verify that the corresponding keys match? I'm guessing
    > rsa->n would suffice for RSA, would dsa->p and dsa->q be an appropriate
    > choice?
    >
    > Thanks!
    >
    > Brian


    Simple method, without having to know key internals, is to do a sign
    followed by a verify on some random digest. If the keys match then the
    verify should pass.


    -jb
    --
    Real computer scientists don't comment their code. The identifiers are
    so long they can't afford the disk space.
    __________________________________________________ ____________________
    OpenSSL Project http://www.openssl.org
    User Support Mailing List openssl-users@openssl.org
    Automated List Manager majordomo@openssl.org


+ Reply to Thread