I'm using the following code to create an RSA key pair.  After
creating the keys, I would like to store them in our application
database.  I will also need to retrieve those keys to sign and verify
hash values.  Can someone point me in the right direction regarding
storage/retrieval of raw keys.

Thanks,

Terry


-----

int main()
{
  SECKEYPrivateKey *priv_key=NULL;
  SECKEYPublicKey *pub_key = NULL;

  NSS_NoDB_Init("/home/thm/KeyTest");

  priv_key = SECKEY_CreateRSAPrivateKey(640, &pub_key, NULL);

  if (priv_key == NULL) {
    printf("priv_key == NULL\n");
  }

  /* Need to save public and private keys to a db here */

  NSS_Shutdown();

  return(0);
}

Reply via email to