diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2016-02-04 23:18:57 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2016-02-05 00:33:33 +0000 |
commit | 7fc7d1a7bdeda7e448c13e6fecce96a53b7a62d2 (patch) | |
tree | 617025d4cebdd22a19d36618cfd7f69b17d3e9c2 /include | |
parent | ac3e3665016e4441475276461d5f910eb9e9ea15 (diff) |
Add EC_KEY_priv2buf()
Add new function EC_KEY_priv2buf() to allocated and encode private
key octet in one call. Update and simplify ASN.1 and print routines.
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/ec.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/openssl/ec.h b/include/openssl/ec.h index 7fed45f7e6..e39704b355 100644 --- a/include/openssl/ec.h +++ b/include/openssl/ec.h @@ -953,6 +953,13 @@ int EC_KEY_oct2priv(EC_KEY *key, unsigned char *buf, size_t len); size_t EC_KEY_priv2oct(const EC_KEY *key, unsigned char *buf, size_t len); +/** Encodes an EC_KEY private key to an allocated octet string + * \param key key to encode + * \param pbuf returns pointer to allocated buffer + * \return the length of the encoded octet string or 0 if an error occurred + */ + +size_t EC_KEY_priv2buf(const EC_KEY *eckey, unsigned char **pbuf); /********************************************************************/ /* de- and encoding functions for SEC1 ECPrivateKey */ |