Lines Matching refs:key

54     "private-key",
55 "public-key"
58 /* These specifications are needed for key-pair generation; the caller
103 /* A single key. */
107 gcry_ac_key_type_t type; /* Type of the key. */
110 /* A key pair. */
1456 /* Initialize a key from a given data set. */
1460 _gcry_ac_key_init (gcry_ac_key_t *key, gcry_ac_handle_t handle,
1488 *key = key_new;
1500 /* Generates a new key pair via the handle HANDLE of NBITS bits and
1542 /* Allocate key pair. */
1635 key_sexp = gcry_sexp_find_token (genkey_sexp_reply, "private-key", 0);
1641 err = ac_data_extract ("private-key", handle->algorithm_name,
1647 key_sexp = gcry_sexp_find_token (genkey_sexp_reply, "public-key", 0);
1653 err = ac_data_extract ("public-key", handle->algorithm_name,
1689 /* Returns the key of type WHICH out of the key pair KEY_PAIR. */
1694 gcry_ac_key_t key;
1702 key = key_pair->secret;
1706 key = key_pair->public;
1710 key = NULL;
1714 return key;
1717 /* Destroys the key KEY. */
1719 _gcry_ac_key_destroy (gcry_ac_key_t key)
1723 if (key)
1725 if (key->data)
1727 for (i = 0; i < key->data->data_n; i++)
1729 if (key->data->data[i].mpi)
1730 gcry_mpi_release (key->data->data[i].mpi);
1731 if (key->data->data[i].name)
1732 gcry_free (key->data->data[i].name);
1734 gcry_free (key->data->data);
1735 gcry_free (key->data);
1737 gcry_free (key);
1741 /* Destroys the key pair KEY_PAIR. */
1753 /* Returns the data set contained in the key KEY. */
1755 _gcry_ac_key_data_get (gcry_ac_key_t key)
1759 return key->data;
1762 /* Verifies that the key KEY is sane via HANDLE. */
1764 _gcry_ac_key_test (gcry_ac_handle_t handle, gcry_ac_key_t key)
1773 err = ac_data_construct (ac_key_identifiers[key->type], 0, 0,
1774 handle->algorithm_name, key->data, &key_sexp);
1787 /* Stores the number of bits of the key KEY in NBITS via HANDLE. */
1790 gcry_ac_key_t key, unsigned int *nbits)
1801 err = ac_data_construct (ac_key_identifiers[key->type],
1802 0, 0, handle->algorithm_name, key->data, &key_sexp);
1822 /* Writes the 20 byte long key grip of the key KEY to KEY_GRIP via
1826 gcry_ac_key_t key, unsigned char *key_grip)
1836 err = ac_data_construct (ac_key_identifiers[key->type], 0, 0,
1837 handle->algorithm_name, key->data, &key_sexp);
1865 /* Encrypts the plain text MPI value DATA_PLAIN with the key public
1871 gcry_ac_key_t key,
1891 if (key->type != GCRY_AC_KEY_PUBLIC)
1897 err = ac_data_construct (ac_key_identifiers[key->type], 0, 0,
1898 handle->algorithm_name, key->data, &sexp_key);
1942 DATA_ENCRYPTED with the secret key KEY under the control of the
1948 gcry_ac_key_t key,
1967 if (key->type != GCRY_AC_KEY_SECRET)
1973 err = ac_data_construct (ac_key_identifiers[key->type], 0, 0,
1974 handle->algorithm_name, key->data, &sexp_key);
2019 /* Signs the data contained in DATA with the secret key KEY and stores
2023 gcry_ac_key_t key,
2043 if (key->type != GCRY_AC_KEY_SECRET)
2049 err = ac_data_construct (ac_key_identifiers[key->type], 0, 0,
2050 handle->algorithm_name, key->data, &sexp_key);
2094 in DATA with the secret key belonging to the public key KEY. */
2097 gcry_ac_key_t key,
2115 err = ac_data_construct ("public-key", 0, 0,
2116 handle->algorithm_name, key->data, &sexp_key);
2120 if (key->type != GCRY_AC_KEY_PUBLIC)
2247 /* Figure out key length in bytes. */
2321 /* Figure out key size. */
2729 gcry_ac_key_t key,
2735 ac_es_dencode_prepare_pkcs_v1_5 (gcry_ac_handle_t handle, gcry_ac_key_t key,
2744 err = _gcry_ac_key_get_nbits (handle, key, &nbits);
2758 ac_ssa_dencode_prepare_pkcs_v1_5 (gcry_ac_handle_t handle, gcry_ac_key_t key,
2769 err = _gcry_ac_key_get_nbits (handle, key, &k);
2824 ac_dencode_prepare (gcry_ac_handle_t handle, gcry_ac_key_t key, void *opts,
2837 err = (*scheme.dencode_prepare) (handle, key, opts, options_em);
2883 M_N, with the public key KEY_PUBLIC according to the Encryption
2892 gcry_ac_key_t key,
2927 if (key->type != GCRY_AC_KEY_PUBLIC)
2933 err = ac_dencode_prepare (handle, key, opts, *scheme, &opts_em);
2948 err = _gcry_ac_data_encrypt (handle, 0, key, mpi_plain, &data_encrypted);
2975 with the secret key KEY_SECRET according to the Encryption Scheme
2984 gcry_ac_key_t key,
3022 if (key->type != GCRY_AC_KEY_SECRET)
3056 err = _gcry_ac_data_decrypt (handle, 0, key, &mpi_decrypted, data_encrypted);
3064 err = ac_dencode_prepare (handle, key, opts, *scheme, &opts_em);
3091 secret key KEY according to the Signature Scheme SCHEME_ID. Handle
3100 gcry_ac_key_t key,
3128 if (key->type != GCRY_AC_KEY_SECRET)
3142 err = ac_dencode_prepare (handle, key, opts, *scheme, &opts_em);
3157 err = _gcry_ac_data_sign (handle, key, mpi, &data_signed);
3185 is of size M_N, with the secret key belonging to the public key
3193 gcry_ac_key_t key,
3224 if (key->type != GCRY_AC_KEY_PUBLIC)
3237 err = ac_dencode_prepare (handle, key, opts, *scheme, &opts_em);
3283 err = _gcry_ac_data_verify (handle, key, mpi_data, data_signed);