I am trying to find the analogue of the {i2d,d2i}_{DSA,RSA}PublicKey functions for ECDSA EC_KEY's. As best I can tell, i2dECPKParameters+ECPublicKey_get_octet_string and d2iECPKParameters+ECPublicKey_set_octet_string are the way to do the encoding/decoding of just the public portions of an EC_KEY. However, unlike all the other encoding routines in OpenSSL, ECPublicKey_{set,get}_octet_string() does not advance the supplied buffer after copying the key to it.
Instead, if *in is non-NULL, it remains pointing to the start of the copied key after the function returns (In every other encoding routine I've used *in is advanced to point to the byte after the just encoded data).

Is there a reason these functions deviates from the normal OpenSSL behavior? It was hard enough to figure out the unwritten rules of when the input buffer does and does not get advanced to begin with, and now if some functions adhere to it and some don't...

Thanks,
Eric

______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]

Reply via email to