psa_generate_key failed! (Error: -134)

I am using NCS 3.0.0 and I want to generate keys ...
But the method I am using to generate keys is giving me this error

Here is the code where it is returning error:


psa_set_key_usage_flags(&key_attributes, PSA_KEY_USAGE_SIGN_HASH | PSA_KEY_USAGE_DECRYPT | PSA_KEY_USAGE_EXPORT);
psa_set_key_lifetime(&key_attributes, PSA_KEY_PERSISTENCE_VOLATILE);
psa_set_key_algorithm(&key_attributes, PSA_ALG_RSA_PKCS1V15_SIGN(PSA_ALG_SHA_256));
psa_set_key_type(&key_attributes, PSA_KEY_TYPE_RSA_KEY_PAIR);
psa_set_key_bits(&key_attributes, (use_rsa_2048) ? KEY_SIZE : KEY_SIZE_1024);

status = psa_generate_key(&key_attributes, &m_initial_keypair_handle);

if (status != PSA_SUCCESS)
{
LOG_INF("psa_generate_key failed! (Error: %d)", status);
return APP_ERROR;
}


I need to Know How can I generate keys in NCS 3.0.0? Is there any example code for it?
Parents Reply Children
No Data
Related