73 static int do_pk8pkey_fp(FILE *
bp,
EVP_PKEY *x,
int isder,
88 return do_pk8pkey(bp, x, 0, nid, NULL, kstr, klen, cb, u);
95 return do_pk8pkey(bp, x, 0, -1, enc, kstr, klen, cb, u);
102 return do_pk8pkey(bp, x, 1, -1, enc, kstr, klen, cb, u);
106 char *kstr,
int klen,
109 return do_pk8pkey(bp, x, 1, nid, NULL, kstr, klen, cb, u);
113 char *kstr,
int klen,
125 if(enc || (nid != -1)) {
131 PKCS8_PRIV_KEY_INFO_free(p8inf);
139 PKCS8_PRIV_KEY_INFO_free(p8inf);
141 else ret = PEM_write_bio_PKCS8(bp, p8);
146 else ret = PEM_write_bio_PKCS8_PRIV_KEY_INFO(bp, p8inf);
147 PKCS8_PRIV_KEY_INFO_free(p8inf);
170 if(!p8inf)
return NULL;
172 PKCS8_PRIV_KEY_INFO_free(p8inf);
173 if(!ret)
return NULL;
181 #ifndef OPENSSL_NO_FP_API
184 char *kstr,
int klen,
187 return do_pk8pkey_fp(fp, x, 1, -1, enc, kstr, klen, cb, u);
191 char *kstr,
int klen,
194 return do_pk8pkey_fp(fp, x, 1, nid, NULL, kstr, klen, cb, u);
198 char *kstr,
int klen,
201 return do_pk8pkey_fp(fp, x, 0, nid, NULL, kstr, klen, cb, u);
207 return do_pk8pkey_fp(fp, x, 0, -1, enc, kstr, klen, cb, u);
211 char *kstr,
int klen,
220 ret = do_pk8pkey(bp, x, isder, nid, enc, kstr, klen, cb, u);