1*b077aed3SPierre Pronchery/* 2*b077aed3SPierre Pronchery * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. 3*b077aed3SPierre Pronchery * 4*b077aed3SPierre Pronchery * Licensed under the Apache License 2.0 (the "License"). You may not use 5*b077aed3SPierre Pronchery * this file except in compliance with the License. You can obtain a copy 6*b077aed3SPierre Pronchery * in the file LICENSE in the source distribution or at 7*b077aed3SPierre Pronchery * https://www.openssl.org/source/license.html 8*b077aed3SPierre Pronchery */ 9*b077aed3SPierre Pronchery 10*b077aed3SPierre Pronchery#ifndef ENCODER_PROVIDER 11*b077aed3SPierre Pronchery# error Macro ENCODER_PROVIDER undefined 12*b077aed3SPierre Pronchery#endif 13*b077aed3SPierre Pronchery 14*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_type_specific_keypair "type-specific" 15*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_type_specific_params "type-specific" 16*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_type_specific "type-specific" 17*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_type_specific_no_pub "type-specific" 18*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_EncryptedPrivateKeyInfo "EncryptedPrivateKeyInfo" 19*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_PrivateKeyInfo "PrivateKeyInfo" 20*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_SubjectPublicKeyInfo "SubjectPublicKeyInfo" 21*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_DH "dh" 22*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_DHX "dhx" 23*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_DSA "dsa" 24*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_EC "ec" 25*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_RSA "rsa" 26*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_PKCS1 "pkcs1" 27*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_PKCS3 "pkcs3" 28*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_X9_42 "X9.42" 29*b077aed3SPierre Pronchery#define ENCODER_STRUCTURE_X9_62 "X9.62" 30*b077aed3SPierre Pronchery 31*b077aed3SPierre Pronchery/* Arguments are prefixed with '_' to avoid build breaks on certain platforms */ 32*b077aed3SPierre Pronchery#define ENCODER_TEXT(_name, _sym, _fips) \ 33*b077aed3SPierre Pronchery { _name, \ 34*b077aed3SPierre Pronchery "provider=" ENCODER_PROVIDER ",fips=" #_fips ",output=text", \ 35*b077aed3SPierre Pronchery (ossl_##_sym##_to_text_encoder_functions) } 36*b077aed3SPierre Pronchery#define ENCODER(_name, _sym, _fips, _output) \ 37*b077aed3SPierre Pronchery { _name, \ 38*b077aed3SPierre Pronchery "provider=" ENCODER_PROVIDER ",fips=" #_fips ",output=" #_output, \ 39*b077aed3SPierre Pronchery (ossl_##_sym##_to_##_output##_encoder_functions) } 40*b077aed3SPierre Pronchery#define ENCODER_w_structure(_name, _sym, _fips, _output, _structure) \ 41*b077aed3SPierre Pronchery { _name, \ 42*b077aed3SPierre Pronchery "provider=" ENCODER_PROVIDER ",fips=" #_fips ",output=" #_output \ 43*b077aed3SPierre Pronchery ",structure=" ENCODER_STRUCTURE_##_structure, \ 44*b077aed3SPierre Pronchery (ossl_##_sym##_to_##_structure##_##_output##_encoder_functions) } 45*b077aed3SPierre Pronchery 46*b077aed3SPierre Pronchery/* 47*b077aed3SPierre Pronchery * Entries for human text "encoders" 48*b077aed3SPierre Pronchery */ 49*b077aed3SPierre ProncheryENCODER_TEXT("RSA", rsa, yes), 50*b077aed3SPierre ProncheryENCODER_TEXT("RSA-PSS", rsapss, yes), 51*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_DH 52*b077aed3SPierre ProncheryENCODER_TEXT("DH", dh, yes), 53*b077aed3SPierre ProncheryENCODER_TEXT("DHX", dhx, yes), 54*b077aed3SPierre Pronchery#endif 55*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_DSA 56*b077aed3SPierre ProncheryENCODER_TEXT("DSA", dsa, yes), 57*b077aed3SPierre Pronchery#endif 58*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_EC 59*b077aed3SPierre ProncheryENCODER_TEXT("EC", ec, yes), 60*b077aed3SPierre ProncheryENCODER_TEXT("ED25519", ed25519, yes), 61*b077aed3SPierre ProncheryENCODER_TEXT("ED448", ed448, yes), 62*b077aed3SPierre ProncheryENCODER_TEXT("X25519", x25519, yes), 63*b077aed3SPierre ProncheryENCODER_TEXT("X448", x448, yes), 64*b077aed3SPierre Pronchery# ifndef OPENSSL_NO_SM2 65*b077aed3SPierre ProncheryENCODER_TEXT("SM2", sm2, no), 66*b077aed3SPierre Pronchery# endif 67*b077aed3SPierre Pronchery#endif 68*b077aed3SPierre Pronchery 69*b077aed3SPierre Pronchery/* 70*b077aed3SPierre Pronchery * Entries for key type specific output formats. The structure name on these 71*b077aed3SPierre Pronchery * is the same as the key type name. This allows us to say something like: 72*b077aed3SPierre Pronchery * 73*b077aed3SPierre Pronchery * To replace i2d_{TYPE}PrivateKey(), i2d_{TYPE}PublicKey() and 74*b077aed3SPierre Pronchery * i2d_{TYPE}Params(), use OSSL_ENCODER functions with an OSSL_ENCODER_CTX 75*b077aed3SPierre Pronchery * created like this: 76*b077aed3SPierre Pronchery * 77*b077aed3SPierre Pronchery * OSSL_ENCODER_CTX *ctx = 78*b077aed3SPierre Pronchery * OSSL_ENCODER_CTX_new_for_pkey(pkey, selection, "DER", "type-specific", 79*b077aed3SPierre Pronchery * NULL, NULL); 80*b077aed3SPierre Pronchery * 81*b077aed3SPierre Pronchery * To replace PEM_write_bio_{TYPE}PrivateKey(), PEM_write_bio_{TYPE}PublicKey() 82*b077aed3SPierre Pronchery * and PEM_write_bio_{TYPE}Params(), use OSSL_ENCODER functions with an 83*b077aed3SPierre Pronchery * OSSL_ENCODER_CTX created like this: 84*b077aed3SPierre Pronchery * 85*b077aed3SPierre Pronchery * OSSL_ENCODER_CTX *ctx = 86*b077aed3SPierre Pronchery * OSSL_ENCODER_CTX_new_for_pkey(pkey, selection, "PEM", "type-specific", 87*b077aed3SPierre Pronchery * NULL, NULL); 88*b077aed3SPierre Pronchery * 89*b077aed3SPierre Pronchery * We only implement those for which there are current i2d_ and PEM_write_bio 90*b077aed3SPierre Pronchery * implementations. 91*b077aed3SPierre Pronchery */ 92*b077aed3SPierre Pronchery 93*b077aed3SPierre Pronchery/* The RSA encoders only support private key and public key output */ 94*b077aed3SPierre ProncheryENCODER_w_structure("RSA", rsa, yes, der, type_specific_keypair), 95*b077aed3SPierre ProncheryENCODER_w_structure("RSA", rsa, yes, pem, type_specific_keypair), 96*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_DH 97*b077aed3SPierre Pronchery/* DH and X9.42 DH only support key parameters output. */ 98*b077aed3SPierre ProncheryENCODER_w_structure("DH", dh, yes, der, type_specific_params), 99*b077aed3SPierre ProncheryENCODER_w_structure("DH", dh, yes, pem, type_specific_params), 100*b077aed3SPierre ProncheryENCODER_w_structure("DHX", dhx, yes, der, type_specific_params), 101*b077aed3SPierre ProncheryENCODER_w_structure("DHX", dhx, yes, pem, type_specific_params), 102*b077aed3SPierre Pronchery#endif 103*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_DSA 104*b077aed3SPierre ProncheryENCODER_w_structure("DSA", dsa, yes, der, type_specific), 105*b077aed3SPierre ProncheryENCODER_w_structure("DSA", dsa, yes, pem, type_specific), 106*b077aed3SPierre Pronchery#endif 107*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_EC 108*b077aed3SPierre Pronchery/* EC only supports keypair and parameters DER and PEM output. */ 109*b077aed3SPierre ProncheryENCODER_w_structure("EC", ec, yes, der, type_specific_no_pub), 110*b077aed3SPierre ProncheryENCODER_w_structure("EC", ec, yes, pem, type_specific_no_pub), 111*b077aed3SPierre Pronchery/* EC supports blob output for the public key */ 112*b077aed3SPierre ProncheryENCODER("EC", ec, yes, blob), 113*b077aed3SPierre Pronchery# ifndef OPENSSL_NO_SM2 114*b077aed3SPierre ProncheryENCODER_w_structure("SM2", sm2, no, der, type_specific_no_pub), 115*b077aed3SPierre ProncheryENCODER_w_structure("SM2", sm2, no, pem, type_specific_no_pub), 116*b077aed3SPierre ProncheryENCODER("SM2", sm2, no, blob), 117*b077aed3SPierre Pronchery# endif 118*b077aed3SPierre Pronchery#endif 119*b077aed3SPierre Pronchery 120*b077aed3SPierre Pronchery/* 121*b077aed3SPierre Pronchery * Entries for the output formats MSBLOB and PVK 122*b077aed3SPierre Pronchery */ 123*b077aed3SPierre ProncheryENCODER("RSA", rsa, yes, msblob), 124*b077aed3SPierre ProncheryENCODER("RSA", rsa, yes, pvk), 125*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_DSA 126*b077aed3SPierre ProncheryENCODER("DSA", dsa, yes, msblob), 127*b077aed3SPierre ProncheryENCODER("DSA", dsa, yes, pvk), 128*b077aed3SPierre Pronchery#endif 129*b077aed3SPierre Pronchery 130*b077aed3SPierre Pronchery/* 131*b077aed3SPierre Pronchery * Entries for encrypted PKCS#8 (EncryptedPrivateKeyInfo), unencrypted PKCS#8 132*b077aed3SPierre Pronchery * (PrivateKeyInfo) and SubjectPublicKeyInfo. The "der" ones are added 133*b077aed3SPierre Pronchery * convenience for any user that wants to use OSSL_ENCODER directly. 134*b077aed3SPierre Pronchery * The "pem" ones also support PEM_write_bio_PrivateKey() and 135*b077aed3SPierre Pronchery * PEM_write_bio_PUBKEY(). 136*b077aed3SPierre Pronchery */ 137*b077aed3SPierre ProncheryENCODER_w_structure("RSA", rsa, yes, der, EncryptedPrivateKeyInfo), 138*b077aed3SPierre ProncheryENCODER_w_structure("RSA", rsa, yes, pem, EncryptedPrivateKeyInfo), 139*b077aed3SPierre ProncheryENCODER_w_structure("RSA", rsa, yes, der, PrivateKeyInfo), 140*b077aed3SPierre ProncheryENCODER_w_structure("RSA", rsa, yes, pem, PrivateKeyInfo), 141*b077aed3SPierre ProncheryENCODER_w_structure("RSA", rsa, yes, der, SubjectPublicKeyInfo), 142*b077aed3SPierre ProncheryENCODER_w_structure("RSA", rsa, yes, pem, SubjectPublicKeyInfo), 143*b077aed3SPierre Pronchery 144*b077aed3SPierre ProncheryENCODER_w_structure("RSA-PSS", rsapss, yes, der, EncryptedPrivateKeyInfo), 145*b077aed3SPierre ProncheryENCODER_w_structure("RSA-PSS", rsapss, yes, pem, EncryptedPrivateKeyInfo), 146*b077aed3SPierre ProncheryENCODER_w_structure("RSA-PSS", rsapss, yes, der, PrivateKeyInfo), 147*b077aed3SPierre ProncheryENCODER_w_structure("RSA-PSS", rsapss, yes, pem, PrivateKeyInfo), 148*b077aed3SPierre ProncheryENCODER_w_structure("RSA-PSS", rsapss, yes, der, SubjectPublicKeyInfo), 149*b077aed3SPierre ProncheryENCODER_w_structure("RSA-PSS", rsapss, yes, pem, SubjectPublicKeyInfo), 150*b077aed3SPierre Pronchery 151*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_DH 152*b077aed3SPierre ProncheryENCODER_w_structure("DH", dh, yes, der, EncryptedPrivateKeyInfo), 153*b077aed3SPierre ProncheryENCODER_w_structure("DH", dh, yes, pem, EncryptedPrivateKeyInfo), 154*b077aed3SPierre ProncheryENCODER_w_structure("DH", dh, yes, der, PrivateKeyInfo), 155*b077aed3SPierre ProncheryENCODER_w_structure("DH", dh, yes, pem, PrivateKeyInfo), 156*b077aed3SPierre ProncheryENCODER_w_structure("DH", dh, yes, der, SubjectPublicKeyInfo), 157*b077aed3SPierre ProncheryENCODER_w_structure("DH", dh, yes, pem, SubjectPublicKeyInfo), 158*b077aed3SPierre Pronchery 159*b077aed3SPierre ProncheryENCODER_w_structure("DHX", dhx, yes, der, EncryptedPrivateKeyInfo), 160*b077aed3SPierre ProncheryENCODER_w_structure("DHX", dhx, yes, pem, EncryptedPrivateKeyInfo), 161*b077aed3SPierre ProncheryENCODER_w_structure("DHX", dhx, yes, der, PrivateKeyInfo), 162*b077aed3SPierre ProncheryENCODER_w_structure("DHX", dhx, yes, pem, PrivateKeyInfo), 163*b077aed3SPierre ProncheryENCODER_w_structure("DHX", dhx, yes, der, SubjectPublicKeyInfo), 164*b077aed3SPierre ProncheryENCODER_w_structure("DHX", dhx, yes, pem, SubjectPublicKeyInfo), 165*b077aed3SPierre Pronchery#endif 166*b077aed3SPierre Pronchery 167*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_DSA 168*b077aed3SPierre ProncheryENCODER_w_structure("DSA", dsa, yes, der, EncryptedPrivateKeyInfo), 169*b077aed3SPierre ProncheryENCODER_w_structure("DSA", dsa, yes, pem, EncryptedPrivateKeyInfo), 170*b077aed3SPierre ProncheryENCODER_w_structure("DSA", dsa, yes, der, PrivateKeyInfo), 171*b077aed3SPierre ProncheryENCODER_w_structure("DSA", dsa, yes, pem, PrivateKeyInfo), 172*b077aed3SPierre ProncheryENCODER_w_structure("DSA", dsa, yes, der, SubjectPublicKeyInfo), 173*b077aed3SPierre ProncheryENCODER_w_structure("DSA", dsa, yes, pem, SubjectPublicKeyInfo), 174*b077aed3SPierre Pronchery#endif 175*b077aed3SPierre Pronchery 176*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_EC 177*b077aed3SPierre ProncheryENCODER_w_structure("EC", ec, yes, der, EncryptedPrivateKeyInfo), 178*b077aed3SPierre ProncheryENCODER_w_structure("EC", ec, yes, pem, EncryptedPrivateKeyInfo), 179*b077aed3SPierre ProncheryENCODER_w_structure("EC", ec, yes, der, PrivateKeyInfo), 180*b077aed3SPierre ProncheryENCODER_w_structure("EC", ec, yes, pem, PrivateKeyInfo), 181*b077aed3SPierre ProncheryENCODER_w_structure("EC", ec, yes, der, SubjectPublicKeyInfo), 182*b077aed3SPierre ProncheryENCODER_w_structure("EC", ec, yes, pem, SubjectPublicKeyInfo), 183*b077aed3SPierre Pronchery 184*b077aed3SPierre ProncheryENCODER_w_structure("X25519", x25519, yes, der, EncryptedPrivateKeyInfo), 185*b077aed3SPierre ProncheryENCODER_w_structure("X25519", x25519, yes, pem, EncryptedPrivateKeyInfo), 186*b077aed3SPierre ProncheryENCODER_w_structure("X25519", x25519, yes, der, PrivateKeyInfo), 187*b077aed3SPierre ProncheryENCODER_w_structure("X25519", x25519, yes, pem, PrivateKeyInfo), 188*b077aed3SPierre ProncheryENCODER_w_structure("X25519", x25519, yes, der, SubjectPublicKeyInfo), 189*b077aed3SPierre ProncheryENCODER_w_structure("X25519", x25519, yes, pem, SubjectPublicKeyInfo), 190*b077aed3SPierre Pronchery 191*b077aed3SPierre ProncheryENCODER_w_structure("X448", x448, yes, der, EncryptedPrivateKeyInfo), 192*b077aed3SPierre ProncheryENCODER_w_structure("X448", x448, yes, pem, EncryptedPrivateKeyInfo), 193*b077aed3SPierre ProncheryENCODER_w_structure("X448", x448, yes, der, PrivateKeyInfo), 194*b077aed3SPierre ProncheryENCODER_w_structure("X448", x448, yes, pem, PrivateKeyInfo), 195*b077aed3SPierre ProncheryENCODER_w_structure("X448", x448, yes, der, SubjectPublicKeyInfo), 196*b077aed3SPierre ProncheryENCODER_w_structure("X448", x448, yes, pem, SubjectPublicKeyInfo), 197*b077aed3SPierre Pronchery 198*b077aed3SPierre ProncheryENCODER_w_structure("ED25519", ed25519, yes, der, EncryptedPrivateKeyInfo), 199*b077aed3SPierre ProncheryENCODER_w_structure("ED25519", ed25519, yes, pem, EncryptedPrivateKeyInfo), 200*b077aed3SPierre ProncheryENCODER_w_structure("ED25519", ed25519, yes, der, PrivateKeyInfo), 201*b077aed3SPierre ProncheryENCODER_w_structure("ED25519", ed25519, yes, pem, PrivateKeyInfo), 202*b077aed3SPierre ProncheryENCODER_w_structure("ED25519", ed25519, yes, der, SubjectPublicKeyInfo), 203*b077aed3SPierre ProncheryENCODER_w_structure("ED25519", ed25519, yes, pem, SubjectPublicKeyInfo), 204*b077aed3SPierre Pronchery 205*b077aed3SPierre ProncheryENCODER_w_structure("ED448", ed448, yes, der, EncryptedPrivateKeyInfo), 206*b077aed3SPierre ProncheryENCODER_w_structure("ED448", ed448, yes, pem, EncryptedPrivateKeyInfo), 207*b077aed3SPierre ProncheryENCODER_w_structure("ED448", ed448, yes, der, PrivateKeyInfo), 208*b077aed3SPierre ProncheryENCODER_w_structure("ED448", ed448, yes, pem, PrivateKeyInfo), 209*b077aed3SPierre ProncheryENCODER_w_structure("ED448", ed448, yes, der, SubjectPublicKeyInfo), 210*b077aed3SPierre ProncheryENCODER_w_structure("ED448", ed448, yes, pem, SubjectPublicKeyInfo), 211*b077aed3SPierre Pronchery 212*b077aed3SPierre Pronchery# ifndef OPENSSL_NO_SM2 213*b077aed3SPierre ProncheryENCODER_w_structure("SM2", sm2, no, der, EncryptedPrivateKeyInfo), 214*b077aed3SPierre ProncheryENCODER_w_structure("SM2", sm2, no, pem, EncryptedPrivateKeyInfo), 215*b077aed3SPierre ProncheryENCODER_w_structure("SM2", sm2, no, der, PrivateKeyInfo), 216*b077aed3SPierre ProncheryENCODER_w_structure("SM2", sm2, no, pem, PrivateKeyInfo), 217*b077aed3SPierre ProncheryENCODER_w_structure("SM2", sm2, no, der, SubjectPublicKeyInfo), 218*b077aed3SPierre ProncheryENCODER_w_structure("SM2", sm2, no, pem, SubjectPublicKeyInfo), 219*b077aed3SPierre Pronchery# endif 220*b077aed3SPierre Pronchery#endif 221*b077aed3SPierre Pronchery 222*b077aed3SPierre Pronchery/* 223*b077aed3SPierre Pronchery * Entries for key type specific output formats. These are exactly the 224*b077aed3SPierre Pronchery * same as the type specific above, except that they use the key type 225*b077aed3SPierre Pronchery * name as structure name instead of "type-specific", in the call on 226*b077aed3SPierre Pronchery * OSSL_ENCODER_CTX_new_for_pkey(). 227*b077aed3SPierre Pronchery */ 228*b077aed3SPierre Pronchery 229*b077aed3SPierre Pronchery/* The RSA encoders only support private key and public key output */ 230*b077aed3SPierre ProncheryENCODER_w_structure("RSA", rsa, yes, der, RSA), 231*b077aed3SPierre ProncheryENCODER_w_structure("RSA", rsa, yes, pem, RSA), 232*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_DH 233*b077aed3SPierre Pronchery/* DH and X9.42 DH only support key parameters output. */ 234*b077aed3SPierre ProncheryENCODER_w_structure("DH", dh, yes, der, DH), 235*b077aed3SPierre ProncheryENCODER_w_structure("DH", dh, yes, pem, DH), 236*b077aed3SPierre ProncheryENCODER_w_structure("DHX", dhx, yes, der, DHX), 237*b077aed3SPierre ProncheryENCODER_w_structure("DHX", dhx, yes, pem, DHX), 238*b077aed3SPierre Pronchery#endif 239*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_DSA 240*b077aed3SPierre ProncheryENCODER_w_structure("DSA", dsa, yes, der, DSA), 241*b077aed3SPierre ProncheryENCODER_w_structure("DSA", dsa, yes, pem, DSA), 242*b077aed3SPierre Pronchery#endif 243*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_EC 244*b077aed3SPierre ProncheryENCODER_w_structure("EC", ec, yes, der, EC), 245*b077aed3SPierre ProncheryENCODER_w_structure("EC", ec, yes, pem, EC), 246*b077aed3SPierre Pronchery#endif 247*b077aed3SPierre Pronchery 248*b077aed3SPierre Pronchery/* 249*b077aed3SPierre Pronchery * Additional entries with structure names being the standard name. 250*b077aed3SPierre Pronchery * This is entirely for the convenience of the user that wants to use 251*b077aed3SPierre Pronchery * OSSL_ENCODER directly with names they may fancy. These do not impact 252*b077aed3SPierre Pronchery * on libcrypto functionality in any way. 253*b077aed3SPierre Pronchery */ 254*b077aed3SPierre Pronchery/* PKCS#1 is a well known for plain RSA keys, so we add that too */ 255*b077aed3SPierre ProncheryENCODER_w_structure("RSA", rsa, yes, der, PKCS1), 256*b077aed3SPierre ProncheryENCODER_w_structure("RSA", rsa, yes, pem, PKCS1), 257*b077aed3SPierre ProncheryENCODER_w_structure("RSA-PSS", rsapss, yes, der, PKCS1), 258*b077aed3SPierre ProncheryENCODER_w_structure("RSA-PSS", rsapss, yes, pem, PKCS1), 259*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_DH 260*b077aed3SPierre Pronchery/* PKCS#3 defines the format for DH parameters */ 261*b077aed3SPierre ProncheryENCODER_w_structure("DH", dh, yes, der, PKCS3), 262*b077aed3SPierre ProncheryENCODER_w_structure("DH", dh, yes, pem, PKCS3), 263*b077aed3SPierre Pronchery/* X9.42 defines the format for DHX parameters */ 264*b077aed3SPierre ProncheryENCODER_w_structure("DHX", dhx, yes, der, X9_42), 265*b077aed3SPierre ProncheryENCODER_w_structure("DHX", dhx, yes, pem, X9_42), 266*b077aed3SPierre Pronchery#endif 267*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_EC 268*b077aed3SPierre Pronchery/* RFC 5915 defines the format for EC keys and parameters */ 269*b077aed3SPierre ProncheryENCODER_w_structure("EC", ec, yes, der, X9_62), 270*b077aed3SPierre ProncheryENCODER_w_structure("EC", ec, yes, pem, X9_62), 271*b077aed3SPierre Pronchery#endif 272