Lines Matching refs:pkey

69 static int dsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)
126 EVP_PKEY_assign_DSA(pkey, dsa);
138 static int dsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
146 dsa=pkey->pkey.dsa;
147 if (pkey->save_parameters && dsa->p && dsa->q && dsa->g)
190 static int dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
283 EVP_PKEY_assign_DSA(pkey, dsa);
303 static int dsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
318 params->length = i2d_DSAparams(pkey->pkey.dsa, &params->data);
327 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dsa->priv_key, NULL);
355 static int int_dsa_size(const EVP_PKEY *pkey)
357 return(DSA_size(pkey->pkey.dsa));
360 static int dsa_bits(const EVP_PKEY *pkey)
362 return BN_num_bits(pkey->pkey.dsa->p);
365 static int dsa_missing_parameters(const EVP_PKEY *pkey)
368 dsa=pkey->pkey.dsa;
378 if ((a=BN_dup(from->pkey.dsa->p)) == NULL)
380 if (to->pkey.dsa->p != NULL)
381 BN_free(to->pkey.dsa->p);
382 to->pkey.dsa->p=a;
384 if ((a=BN_dup(from->pkey.dsa->q)) == NULL)
386 if (to->pkey.dsa->q != NULL)
387 BN_free(to->pkey.dsa->q);
388 to->pkey.dsa->q=a;
390 if ((a=BN_dup(from->pkey.dsa->g)) == NULL)
392 if (to->pkey.dsa->g != NULL)
393 BN_free(to->pkey.dsa->g);
394 to->pkey.dsa->g=a;
400 if ( BN_cmp(a->pkey.dsa->p,b->pkey.dsa->p) ||
401 BN_cmp(a->pkey.dsa->q,b->pkey.dsa->q) ||
402 BN_cmp(a->pkey.dsa->g,b->pkey.dsa->g))
410 if (BN_cmp(b->pkey.dsa->pub_key,a->pkey.dsa->pub_key) != 0)
416 static void int_dsa_free(EVP_PKEY *pkey)
418 DSA_free(pkey->pkey.dsa);
490 static int dsa_param_decode(EVP_PKEY *pkey,
499 EVP_PKEY_assign_DSA(pkey, dsa);
503 static int dsa_param_encode(const EVP_PKEY *pkey, unsigned char **pder)
505 return i2d_DSAparams(pkey->pkey.dsa, pder);
508 static int dsa_param_print(BIO *bp, const EVP_PKEY *pkey, int indent,
511 return do_dsa_print(bp, pkey->pkey.dsa, indent, 0);
514 static int dsa_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent,
517 return do_dsa_print(bp, pkey->pkey.dsa, indent, 1);
521 static int dsa_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent,
524 return do_dsa_print(bp, pkey->pkey.dsa, indent, 2);
527 static int old_dsa_priv_decode(EVP_PKEY *pkey,
536 EVP_PKEY_assign_DSA(pkey, dsa);
540 static int old_dsa_priv_encode(const EVP_PKEY *pkey, unsigned char **pder)
542 return i2d_DSAPrivateKey(pkey->pkey.dsa, pder);
591 static int dsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
606 if (!OBJ_find_sigid_by_algs(&snid, hnid, EVP_PKEY_id(pkey)))
623 if (!OBJ_find_sigid_by_algs(&snid, hnid, EVP_PKEY_id(pkey)))