EVP_PKEY_copy_parameters(X509_get_pubkey(x),pkey); EVP_PKEY_save_parameters(X509_get_pubkey(x),1);
EVP_PKEY *pktmp;  pktmp = X509_get_pubkey(x); EVP_PKEY_copy_parameters(pktmp,pkey); EVP_PKEY_save_parameters(pktmp,1); EVP_PKEY_free(pktmp);
static int sign(x, pkey, days, digest)X509 *x;EVP_PKEY *pkey;int days;EVP_MD *digest;	{	EVP_PKEY_copy_parameters(X509_get_pubkey(x),pkey);	EVP_PKEY_save_parameters(X509_get_pubkey(x),1);	if (!X509_set_issuer_name(x,X509_get_subject_name(x))) goto err;	if (X509_gmtime_adj(X509_get_notBefore(x),0) == NULL) goto err;	/* Lets just make it 12:00am GMT, Jan 1 1970 */	/* memcpy(x->cert_info->validity->notBefore,"700101120000Z",13); */	/* 28 days to be certified */	if (X509_gmtime_adj(X509_get_notAfter(x),(long)60*60*24*days) == NULL)		goto err;	if (!X509_set_pubkey(x,pkey)) goto err;	if (!X509_sign(x,pkey,digest)) goto err;	return(1);err:	ERR_print_errors(bio_err);	return(0);	}