heimdal and raw rsa parameters

Matthieu Patou mat at samba.org
Tue Sep 28 01:49:17 MDT 2010

  Hi Love,

First I really enjoyed meeting you at the SNIA plugfest was a real 
pleasure hope to see you next year !

Otherwise, my current usage of heimdal is pretty good and it seems to 
cover most of my needs.

The last bit I'm starting is using and storing the private key in the 
format MS AD do, this imply working with RSA raw parameter like modulus, 
private exponent, public exponent, ... all of this stored in the little 
endian format.

  So basically I'll have a function that will create a function to 
transform the microsoft format to a RSA hx509_private_key like this

         hx509_context hctx;
         RSA *rsa;

         pk = talloc(mem_ctx, hx509_private_key);

         rsa = RSA_new();
         rsa->n = BN_bin2bn(keypair->modulus.data, 
keypair->modulus.length, NULL);
         mp_invmod(&q, &p, &iqmp);
         rsa->iqmp = mpz2BN(&iqmp)
         _hx509_private_key_assign_rsa(*pk, &rsa);

And mostly the opposite for the other way round (that I plan to do a bit 
later this week).


Matthieu Patou
Samba Team        http://samba.org

More information about the samba-technical mailing list