D2I_ECPKPARAMETERS(3)
π NAME π
okay so bestie, this is the manual page for D2I_ECPKPARAMETERS(3), and its whole thing is to decode and encode ASN.1 representations of elliptic curve entities. The full squad is:
d2i_ECPKParameters,i2d_ECPKParameters,d2i_ECPKParameters_bio,i2d_ECPKParameters_bio,d2i_ECPKParameters_fp,i2d_ECPKParameters_fpd2i_ECParameters,i2d_ECParameters,ECParameters_dupd2i_ECPrivateKey,i2d_ECPrivateKey,d2i_ECPrivateKey_bio,i2d_ECPrivateKey_bio,d2i_ECPrivateKey_fp,i2d_ECPrivateKey_fpo2i_ECPublicKey,i2o_ECPublicKeyECPKParameters_print,ECPKParameters_print_fp,ECParameters_print,ECParameters_print_fpd2i_EC_PUBKEY,i2d_EC_PUBKEY,d2i_EC_PUBKEY_bio,i2d_EC_PUBKEY_bio,d2i_EC_PUBKEY_fp,i2d_EC_PUBKEY_fp
β¨ SYNOPSIS β¨
First up, the vibe is libcrypto and this include:
library βlibcryptoβ #include <openssl/ec.h>
Then here's the whole function lineup, exactly as it lives:
EC_GROUP *
d2i_ECPKParameters(EC_GROUP **val_out, const unsigned char **der_in,
long length);
int
i2d_ECPKParameters(const EC_GROUP *val_in, unsigned char **der_out);
EC_GROUP *
d2i_ECPKParameters_bio(BIO *in_bio, EC_GROUP **val_out);
int
i2d_ECPKParameters_bio(BIO *out_bio, EC_GROUP *val_in);
EC_GROUP *
d2i_ECPKParameters_fp(FILE *in_fp, EC_GROUP **val_out);
int
i2d_ECPKParameters_fp(FILE *out_fp, EC_GROUP *val_in);
EC_KEY *
d2i_ECParameters(EC_KEY **val_out, const unsigned char **der_in,
long length);
int
i2d_ECParameters(EC_KEY *val_in, unsigned char **der_out);
EC_KEY *
ECParameters_dup(EC_KEY *val_in);
EC_KEY *
d2i_ECPrivateKey(EC_KEY **val_out, const unsigned char **der_in,
long length);
int
i2d_ECPrivateKey(EC_KEY *val_in, unsigned char **der_out);
EC_KEY *
d2i_ECPrivateKey_bio(BIO *in_bio, EC_KEY **val_out);
int
i2d_ECPrivateKey_bio(BIO *out_bio, EC_KEY *val_in);
EC_KEY *
d2i_ECPrivateKey_fp(FILE *in_fp, EC_KEY **val_out);
int
i2d_ECPrivateKey_fp(FILE *out_fp, EC_KEY *val_in);
EC_KEY *
o2i_ECPublicKey(EC_KEY **val_out, const unsigned char **der_in,
long length);
int
i2o_ECPublicKey(const EC_KEY *val_in, unsigned char **der_out);
int
ECPKParameters_print(BIO *out_bio, const EC_GROUP *val_in, int indent);
int
ECPKParameters_print_fp(FILE *out_fp, const EC_GROUP *val_in,
int indent);
int
ECParameters_print(BIO *out_bio, const EC_KEY *val_in);
int
ECParameters_print_fp(FILE *out_fp, const EC_KEY *val_in);
And over here there's a second include for the pubkey girlies:
#include <openssl/x509.h>
EC_KEY *
d2i_EC_PUBKEY(EC_KEY **val_out, const unsigned char **der_in,
long length);
int
i2d_EC_PUBKEY(EC_KEY *val_in, unsigned char **der_out);
EC_KEY *
d2i_EC_PUBKEY_bio(BIO *in_bio, EC_KEY **val_out);
int
i2d_EC_PUBKEY_bio(BIO *out_bio, EC_KEY *val_in);
EC_KEY *
d2i_EC_PUBKEY_fp(FILE *in_fp, EC_KEY **val_out);
int
i2d_EC_PUBKEY_fp(FILE *out_fp, EC_KEY *val_in);
πΈ DESCRIPTION πΈ
These functions decode and encode elliptic curve keys and parameters. For the full tea on semantics, examples, caveats, and bugs, see ASN1_item_d2i(3).
d2i_ECPKParameters()andi2d_ECPKParameters()decode and encode the parameters of an elliptic curve.d2i_ECPKParameters_bio(),i2d_ECPKParameters_bio(),d2i_ECPKParameters_fp(), andi2d_ECPKParameters_fp()are similar except that they decode or encode using aBIOorFILEpointer. Heads up: these four functions are currently implemented as macros.d2i_ECParameters()does the same parsing asd2i_ECPKParameters()but saves the result in thegroupfield of anEC_KEYstructure.i2d_ECParameters()produces the same output asi2d_ECPKParameters()but usesval_in->groupfor input instead ofval_in.ECParameters_dup()allocates and initializes an emptyEC_KEYobject and copies the EC parameters fromval_into it by callingi2d_ECParameters()andd2i_ECParameters(). If a private or public key or any flags are present inval_in, they are not copied.d2i_ECPrivateKey()andi2d_ECPrivateKey()decode and encode an EC private key using an ASN.1ECPrivateKeystructure defined in RFC 5915 section 3 and used for theprivateKeyfield of the ASN.1PrivateKeyInfostructure defined in RFC 5208 section 5, seePKCS8_PRIV_KEY_INFO_new(3).d2i_ECPrivateKey_bio(),i2d_ECPrivateKey_bio(),d2i_ECPrivateKey_fp(), andi2d_ECPrivateKey_fp()are similar except that they decode or encode using aBIOorFILEpointer.o2i_ECPublicKey()andi2o_ECPublicKey()decode and encode an EC public key. In contrast toASN1_item_d2i(3),o2i_ECPublicKey()requiresval_out,*val_out, and(*val_out)->groupto be non-NULL.ECPKParameters_print()andECPKParameters_print_fp()print human-readable output of the public parameters of theEC_GROUPtoout_bioorout_fp. The output lines are indented byindentspaces.ECParameters_print()andECParameters_print_fp()print the parameter components ofval_intoout_bioorout_fp.d2i_EC_PUBKEY()andi2d_EC_PUBKEY()decode and encode an EC public key using an ASN.1SubjectPublicKeyInfostructure defined in RFC 5280 section 4.1 and documented inX509_PUBKEY_new(3).d2i_EC_PUBKEY_bio(),i2d_EC_PUBKEY_bio(),d2i_EC_PUBKEY_fp(), andi2d_EC_PUBKEY_fp()are similar except that they decode or encode using aBIOorFILEpointer.
π RETURN VALUES π
d2i_ECPKParameters(),d2i_ECPKParameters_bio(), andd2i_ECPKParameters_fp()return a validEC_GROUPstructure orNULLif an error occurs.d2i_ECParameters(),ECParameters_dup(),d2i_ECPrivateKey(),d2i_ECPrivateKey_bio(),d2i_ECPrivateKey_fp(),o2i_ECPublicKey(),d2i_EC_PUBKEY(),d2i_EC_PUBKEY_bio(), andd2i_EC_PUBKEY_fp()return a validEC_KEYstructure orNULLif an error occurs.i2d_ECPKParameters(),i2d_ECParameters(),i2d_ECPrivateKey(),i2o_ECPublicKey(), andi2d_EC_PUBKEY()return the number of bytes successfully encoded or a negative value if an error occurs.i2d_ECPKParameters_bio(),i2d_ECPKParameters_fp(),i2d_ECPrivateKey_bio(),i2d_ECPrivateKey_fp(),ECPKParameters_print(),ECPKParameters_print_fp(),ECParameters_print(),ECParameters_print_fp(),i2d_EC_PUBKEY_bio(), andi2d_EC_PUBKEY_fp()return1for success or0if an error occurs.
π¦ SEE ALSO π¦
Go check out these besties:
ASN1_item_d2i(3)EC_GROUP_new_by_curve_name(3)EC_KEY_new(3)EVP_PKEY_set1_EC_KEY(3)PEM_write_ECPrivateKey(3)PKCS8_PRIV_KEY_INFO_new(3)X509_PUBKEY_new(3)
π STANDARDS π
- RFC 5915: Elliptic Curve Private Key Structure
- RFC 5208: Public-Key Cryptography Standards (PKCS) #8: Private-Key Information Syntax Specification
- RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 4.1: Basic Certificate Fields
π HISTORY π
d2i_ECPKParameters(), i2d_ECPKParameters(), d2i_ECPKParameters_bio(), i2d_ECPKParameters_bio(), d2i_ECPKParameters_fP(), i2d_ECPKParameters_fp(), d2i_ECParameters(), i2d_ECParameters(), ECParameters_dup(), d2i_ECPrivateKey(), i2d_ECPrivateKey(), d2i_ECPrivateKey_bio(), i2d_ECPrivateKey_bio(), d2i_ECPrivateKey_fp(), i2d_ECPrivateKey_fp(), o2i_ECPublicKey(), i2o_ECPublicKey(), ECPKParameters_print(), ECPKParameters_print_fp(), ECParameters_print(), ECParameters_print_fp(), d2i_EC_PUBKEY(), i2d_EC_PUBKEY(), d2i_EC_PUBKEY_bio(), i2d_EC_PUBKEY_bio(), d2i_EC_PUBKEY_fp(), and i2d_EC_PUBKEY_fp() first appeared in OpenSSL 0.9.8 and have been available since OpenBSD 4.5.
π xoxo, this lil page came from Debian, dated June 8, 2025, and it's the D2I_ECPKPARAMETERS(3) manual β bye bestie! π
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
- Copyright (c) 2013, 2015 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms