<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Persistent Key Impot PSA failing with -135 (PSA_ERROR_INVALID_ARGUMENT)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114603/persistent-key-impot-psa-failing-with--135-psa_error_invalid_argument</link><description>Hi, 
 
 I have been using the PSA crypto APIs successfully with volatile keys till now. We want to move on to using persistent keys but I am not able to import a persistent key. I receive an error -135. 
 Here&amp;#39;s my configuration. The build target is a</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Sep 2024 12:16:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114603/persistent-key-impot-psa-failing-with--135-psa_error_invalid_argument" /><item><title>RE: Persistent Key Impot PSA failing with -135 (PSA_ERROR_INVALID_ARGUMENT)</title><link>https://devzone.nordicsemi.com/thread/501922?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2024 12:16:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:872be467-8291-4209-bd27-d3ad99f14a7b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see all of your&amp;nbsp;hmac_import_key() function. Is it from&amp;nbsp;psa_import_key() you get&amp;nbsp;PSA_ERROR_INVALID_ARGUMENT or somewhere else? What&amp;nbsp;exactly are the input arguments?&lt;/p&gt;
&lt;p&gt;From the API doc:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;PSA_ERROR_INVALID_ARGUMENT - The following conditions can result in this error:&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;The key type is invalid.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;The key size is nonzero, and is incompatible with the key data in data.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;The key lifetime is invalid.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;The key identifier is not valid for the key lifetime.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;The key usage flags include invalid values.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;The key’s permitted-usage algorithm is invalid.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;The key attributes, as a whole, are invalid.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;The key data is not correctly formatted for the key type.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>