cryptoservices/filebasedcertificateandkeystores/test/tkeystore/scripts/thwkeystore.txt
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 12 Oct 2009 10:17:04 +0300
changeset 15 da2ae96f639b
permissions -rw-r--r--
Revision: 200941 Kit: 200941

////////////////////////////////////////////////////////////////////////////////////
//	Testing hardware token implementation
////////////////////////////////////////////////////////////////////////////////////

<action>
	<actionname>Delete keystore data file</actionname>
	<actiontype>deletekeystoredata</actiontype>
	<actionbody>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Retrieving label of a particular key store</actionname>
	<actiontype>init</actiontype>
	<actionbody>
		<mode>manager</mode>
		<CheckKeyStoreLabel>1</CheckKeyStoreLabel>
		<keystoreindex>3</keystoreindex>
		<keystorelabel>Hardware plugin implementation</keystorelabel>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>delete keys</actionname>
	<actiontype>deletekeys</actiontype>
	<actionbody></actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>List Keys</actionname>
	<actiontype>listallkeys</actiontype>
	<actionbody>
		<listcount>2</listcount>
		<foundkey>ecckey</foundkey>
		<foundkey>ecckey2</foundkey>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Open a key for signing</actionname>
	<actiontype>open</actiontype>
	<actionbody>
		<hwtype>1</hwtype>
		<operationtype>sign</operationtype>
		<keylabel>ecckey</keylabel>
		<open>ECC</open>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Open a key for decryption</actionname>
	<actiontype>open</actiontype>
	<actionbody>
		<hwtype>1</hwtype>
		<operationtype>decrypt</operationtype>
		<keylabel>ecckey</keylabel>
		<open>ECC</open>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Open a key for signing</actionname>
	<actiontype>sign</actiontype>
	<actionbody>
		<hwtype>0</hwtype>
		<operationtype>sign</operationtype>
		<keylabel>ecckey</keylabel>
		<open>ECC</open>
		<keystorelabel>Hardware plugin implementation</keystorelabel>
	<text>sample text</text>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Open a key for decryption</actionname>
	<actiontype>decrypt</actiontype>
	<actionbody>
		<hwtype>0</hwtype>
		<operationtype>decrypt</operationtype>
		<keylabel>ecckey2</keylabel>
		<open>ECC</open>
		<keystorelabel>Hardware plugin implementation</keystorelabel>
	<text>sample text</text>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Open a key for signing</actionname>
	<actiontype>sign</actiontype>
	<actionbody>
		<hwtype>1</hwtype>
		<operationtype>sign</operationtype>
		<keylabel>ecckey</keylabel>
		<open>ECC</open>
		<keystorelabel>Hardware plugin implementation</keystorelabel>
	<text>sample text</text>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Open a key for decryption</actionname>
	<actiontype>decrypt</actiontype>
	<actionbody>
		<hwtype>1</hwtype>
		<operationtype>decrypt</operationtype>
		<keylabel>ecckey2</keylabel>
		<open>ECC</open>
		<keystorelabel>Hardware plugin implementation</keystorelabel>
	<text>sample text</text>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>List Keys</actionname>
	<actiontype>listkeys</actiontype>
	<actionbody>
		<foundkey>ecckey3</foundkey>
		<listingstatus>fail</listingstatus>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Add a key</actionname>
	<actiontype>addkey</actiontype>
	<actionbody>
		<keyusage>allusagesbutNR</keyusage>
		<keysize>512</keysize>
		<keylabel>banana</keylabel>
		<keyalgorithm>RSA</keyalgorithm>
		<keyaccesstype>Extractable</keyaccesstype>
		<keystore>0</keystore>
		<usekeystore>Hardware plugin implementation</usekeystore>
	</actionbody>
	<actionresult>
		<return>KErrNotSupported</return>
	</actionresult>
</action>

<action>
	<actionname>Get key information</actionname>
	<actiontype>getkeyinfo</actiontype>
	<actionbody>
		<keylabel>ecckey</keylabel>
	</actionbody>
	<actionresult>
		<return>KErrNotSupported</return>
	</actionresult>
</action>

<action>
	<actionname>Open a key as a RSA signer</actionname>
	<actiontype>open</actiontype>
	<actionbody>
		<keylabel>ecckey</keylabel>
		<open>RSA</open>
	</actionbody>
	<actionresult>
		<return>KErrNotSupported</return>
	</actionresult>
</action>

<action>
	<actionname>Open a key as a DSA signer</actionname>
	<actiontype>open</actiontype>
	<actionbody>
		<keylabel>ecckey</keylabel>
		<open>DSA</open>
	</actionbody>
	<actionresult>
		<return>KErrNotSupported</return>
	</actionresult>
</action>

<action>
	<actionname>Open key for decrypt</actionname>
	<actiontype>open</actiontype>
	<actionbody>
		<keylabel>ecckey</keylabel>
		<open>Decrypt</open>
	</actionbody>
	<actionresult>
		<return>KErrNotSupported</return>
	</actionresult>
</action>

<action>
<actionname>Import a key</actionname>
	<actiontype>importkey</actiontype>
	<actionbody>
		<ImportData>pkcs8rsa.001</ImportData>
		<keyusage>allusagesbutNR</keyusage>
		<keylabel>ImportHardwareKey</keylabel>
		<keyaccesstype>NeverExtractable</keyaccesstype>
		<usekeystore>Hardware plugin implementation</usekeystore>
	</actionbody>
	<actionresult>
		<return>KErrNotSupported</return>
	</actionresult>
</action>

<action>
<actionname>Import a PKCS5 encrypted RSA key</actionname>
	<actiontype>importkey</actiontype>
	<actionbody>
		<ImportData>encryptPK8rsaDER.txt</ImportData>
		<keyusage>allusagesbutNR</keyusage>
		<keylabel>ImportEncryptedHardwareKey</keylabel>
		<keyaccesstype>NeverExtractable</keyaccesstype>
		<usekeystore>Hardware plugin implementation</usekeystore>
	</actionbody>
	<actionresult>
		<return>KErrNotSupported</return>
	</actionresult>
</action>

<action>
<actionname>Export a key</actionname>
	<actiontype>exportkey</actiontype>
	<actionbody>
		<ExportFile>export_hardware_key</ExportFile>
		<keyusage>Derive</keyusage>
		<keylabel>ecckey</keylabel>
		<keyalgorithm>ECC</keyalgorithm>
		<encrypted>0</encrypted>
	</actionbody>
	<actionresult>
		<return>KErrNotSupported</return>
	</actionresult>
</action>

<action>
<actionname>Export a key in encrypted format </actionname>
	<actiontype>exportkey</actiontype>
	<actionbody>
		<ExportFile>export_encrypted_hardware_key</ExportFile>
		<keyusage>Derive</keyusage>
		<keylabel>ecckey</keylabel>
		<keyalgorithm>ECC</keyalgorithm>
		<encrypted>1</encrypted>
	</actionbody>
	<actionresult>
		<return>KErrNotSupported</return>
	</actionresult>
</action>

<action>
	<actionname>Set use policy</actionname>
	<actiontype>setusepolicy</actiontype>
	<actionbody>
		<keylabel>ecckey</keylabel>
		<policy>
			<secureid>0x101FFFFF</secureid>
			<capability>DRM</capability>
			<capability>ReadUserData</capability>
		</policy>
	</actionbody>
	<actionresult>
		<return>KErrNotSupported</return>
	</actionresult>
</action>

<action>
	<actionname>Set use policy</actionname>
	<actiontype>setmanagementpolicy</actiontype>
	<actionbody>
		<keylabel>ecckey</keylabel>
		<policy>
			<secureid>0x101FFFFF</secureid>
			<capability>DRM</capability>
			<capability>ReadUserData</capability>
		</policy>
	</actionbody>
	<actionresult>
		<return>KErrNotSupported</return>
	</actionresult>
</action>

<action>
	<actionname>Delete a key</actionname>
	<actiontype>deletekeys</actiontype>
	<actionbody>
		<keyalgorithm>ECC</keyalgorithm>
		<keylabel>ecckey</keylabel>
	</actionbody>
	<actionresult>
		<return>KErrNotSupported</return>
	</actionresult>
</action>

<action>
	<actionname>Closing key store</actionname>
	<actiontype>delete</actiontype>
	<actionbody></actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Sleep 5 seconds</actionname>
	<actiontype>sleep</actiontype>
	<actionbody>
          <seconds>5</seconds>
        </actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>