Lines Matching defs:key

48  * kExampleRSAKeyDER is an RSA private key in ASN.1, DER format. Of course, you
49 * should never use this key anywhere but in an example.
106 * kExampleDSAKeyDER is a DSA private key in ASN.1, DER format. Of course, you
107 * should never use this key anywhere but in an example.
153 * kExampleBadRSAKeyDER is an RSA private key in ASN.1, DER format. The private
249 * kExampleBad2RSAKeyDER is an RSA private key in ASN.1, DER format. All
336 * kExampleECKeyDER is a sample EC private key encoded as an ECPrivateKey
354 * kExampleBadECKeyDER is a sample EC private key encoded as an ECPrivateKey
355 * structure. The private key is equal to the order and will fail to import
382 * kExampleBadECPubKeyDER is a sample EC public key with a wrong OID
424 /* kExampleDHKeyDER is a DH private key in ASN.1, DER format. */
571 0, 0, 1 /* Since there are no "params" in an RSA key this passes */, 0},
574 /* group is also associated in our pub key */
650 unsigned char key[] = {
657 NULL, key, sizeof(key));
750 * Test combinations of private, public, missing and private + public key
873 * Test combinations of private, public, missing and private + public key
949 * We indicate only parameters here, in spite of having built a key that
952 * key without a corresponding public key
998 /* Try key equality */
1056 /* Test that using a legacy EC key with only a private key in it works */
1092 * The EVP_DigestSignInit function should create the key on the
1458 unsigned char key[16];
1473 memset(key, 1, 16);
1475 key, 16)))
1667 /* Tests loading a bad key in PKCS8 format */
1799 EVP_PKEY *params = NULL, *key = NULL;
1806 /* Create key parameters */
1815 /* Create key */
1818 || !TEST_true(EVP_PKEY_keygen(kctx, &key))
1819 || !TEST_ptr(key))
1822 /* Check that the encoding got all the way into the key */
1823 if (!TEST_true(evp_keymgmt_util_export(key, OSSL_KEYMGMT_SELECT_ALL,
1830 EVP_PKEY_free(key);
2213 * to HMAC with a zero length key
2343 static unsigned char key[] = {
2365 /* Test a CMAC key created using the "generated" method */
2372 sizeof(key), (void *)key), 0)
2382 * Test a CMAC key using the direct method, and compare with the mac
2385 pkey = EVP_PKEY_new_CMAC_key(NULL, key, sizeof(key), EVP_aes_256_ecb());
2408 unsigned char key[] = "012345678901234567890123456789";
2428 || !TEST_int_gt(EVP_PKEY_CTX_set1_hkdf_key(pctx, key,
2429 sizeof(key) - 1), 0)
2452 unsigned char key[] = "";
2470 || !TEST_int_gt(EVP_PKEY_CTX_set1_hkdf_key(pctx, key,
2471 sizeof(key) - 1), 0)
2639 || !TEST_int_eq(strcmp(params[0].key, OSSL_DIGEST_PARAM_SSL3_MS), 0)
2640 /* The final key should be NULL */
2641 || !TEST_ptr_null(params[1].key))
2720 * Test combinations of private, public, missing and private + public key
2781 EVP_PKEY *key = NULL;
2787 if (!TEST_ptr(key = load_example_rsa_key())
2788 || !TEST_ptr(key_ctx = EVP_PKEY_CTX_new_from_pkey(0, key, 0)))
2827 EVP_PKEY_free(key);
2838 const unsigned char key[32] = {
2857 key, iv))
2874 if (!TEST_true(EVP_DecryptInit_ex(ctx, cipher, NULL, key, iv))
2903 * Test combinations of private, public, missing and private + public key
3005 /* Here we create an empty RSA key that serves as our template */
3134 unsigned char key[16] = {0x4c, 0x43, 0xdb, 0xdd, 0x42, 0x73, 0x47, 0xd1,
3235 || !TEST_true(EVP_EncryptInit_ex(ctx, type, NULL, key, init_iv))
3272 static const unsigned char key[24] = {
3346 || !TEST_true(EVP_EncryptInit_ex(ctx, type, NULL, key, init_iv))
3570 const unsigned char *key;
3680 if (t->keyfirst && !TEST_true(EVP_CipherInit_ex(ctx, NULL, NULL, t->key, NULL, -1))) {
3688 if (t->keyfirst == 0 && !TEST_true(EVP_CipherInit_ex(ctx, NULL, NULL, t->key, NULL, -1))) {
4099 static int custom_pmeth_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
4102 int (*pderive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
4105 return pderive(ctx, key, keylen);
4219 /* Convert to a legacy key */
4417 static int custom_ciph_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
4569 /* We used a bad key. We expect a failure here */
4641 /* Test that creating ECX keys with a short private key fails as expected */
4676 /* Test that trying to sign with a public key errors out gracefully */
4697 return TEST_skip("no public key present");