[xmlsec] Using OpenSSL beside XMLSec

Martin Salo Martin.Salo at gmx.net
Fri Aug 31 03:05:49 PDT 2007


Hello Roumen,

if I use BIO_new_file+RSA_print I can write the key to a file. Doese this indicate that I'm using a wrong Runtime? (Because this time the IO-Stream was created by OpenSSL.) But Igor wrote I should use the MultithreadedDLL runtime. If I use another one I get a crash when I'm usign the XMLSec functions.


Regards

Martin.

// This code works:
void RsaTest::CreateRSAKey() {

	// Do some init:
	BIGNUM *oBigNbr = BN_new();
	RSA *oRsaKey = RSA_new();
	int iLength=2048;

	BN_set_word(oBigNbr, RSA_F4);

	// Generate the key:
	RSA_generate_key_ex(oRsaKey, iLength, oBigNbr, 0);

	// Write key to hard disk (for testing)
	BIO *oFile = BIO_new_file("X:\\MyKey.txt", "w");
	RSA_print(oFile, oRsaKey, 1);
	BIO_free(oFile);

	// Clean up:
	BN_free(oBigNbr);
	RSA_free(oRsaKey);
}
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger



More information about the xmlsec mailing list