//
// Keystore server OOM tests
//
// Testing key generatation has been diabled for the moment.
//

///////////////////////////////////////////////////////////////////////////////
//				Test case 1: Initialise the store
///////////////////////////////////////////////////////////////////////////////

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

<action>
	<actionname>Start server OOM testing</actionname>
	<actiontype>startserveroom</actiontype>
</action>

<action>
	<actionname>1,Opening key store in manager mode</actionname>
	<actiontype>init</actiontype>
	<actionbody>
		<mode>manager</mode>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.0.1 NOT A TEST Delete everything</actionname>
	<actiontype>deletekeys</actiontype>
	<actionbody></actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>
///////////////////////////////////////////////////////////////////////////////
//				Test case 2: Add the "Banana" key 
///////////////////////////////////////////////////////////////////////////////

<action>
	<actionname>2,Add a key</actionname>
	<actiontype>addkey</actiontype>
	<actionbody>
		<keyusage>allusagesbutNR</keyusage>
		<keysize>512</keysize>
		<keylabel>banana</keylabel>
		<keyalgorithm>RSA</keyalgorithm>
		<keyexportable>IsExportable</keyexportable>
		<keyaccesstype>Extractable</keyaccesstype>
		<serveroom>1</serveroom>
		<passphrase>create pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>2.1,Set passphrase timeout to "don't cache"</actionname>
	<actiontype>settimeout</actiontype>
	<actionbody>
		<keylabel>banana</keylabel>
		<timeout>0</timeout>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

///////////////////////////////////////////////////////////////////////////////
//				Test case 3: List the keys, should only find "Banana"
///////////////////////////////////////////////////////////////////////////////

<action>
	<actionname>3 List everything</actionname>
	<actiontype>listkeys</actiontype>
	<actionbody>
		<listcount>1</listcount>
		<foundkey>banana</foundkey>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

///////////////////////////////////////////////////////////////////////////////
//				Test case 4: Delete "Banana" key 
///////////////////////////////////////////////////////////////////////////////

<action>
	<actionname>4. Delete the key</actionname>
	<actiontype>deletekeys</actiontype>
	<actionbody>
		<keyalgorithm>RSA</keyalgorithm>
		<deletecount>1</deletecount>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>


///////////////////////////////////////////////////////////////////////////////
//				Test case 5: List the keys, should find nothing
///////////////////////////////////////////////////////////////////////////////

<action>
	<actionname>3 List everything</actionname>
	<actiontype>listkeys</actiontype>
	<actionbody>
		<listcount>0</listcount>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>2,Add a larger key</actionname>
	<actiontype>addkey</actiontype>
	<actionbody>
		<keyusage>allusagesbutNR</keyusage>
		<keysize>1024</keysize>
		<keylabel>bigbanana</keylabel>
		<keyalgorithm>RSA</keyalgorithm>
		<keyexportable>IsExportable</keyexportable>
		<keyaccesstype>Extractable</keyaccesstype>
		<serveroom>0</serveroom>
		<passphrase>create pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.1.5.4,Add a key with a very long label</actionname>
	This is to test passing larger ammounts of data over the client/server 
	boundary.
	<actiontype>addkey</actiontype>
	<actionbody>
		<keyusage>allusagesbutNR</keyusage>
		<keysize>1024</keysize>
		<keylabel>
To be, or not to be: that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take arms against a sea of troubles,
And by opposing end them? To die: to sleep;
No more; and by a sleep to say we end
The heart-ache and the thousand natural shocks
That flesh is heir to, 'tis a consummation
Devoutly to be wish'd. To die, to sleep;
To sleep: perchance to dream: ay, there's the rub;
For in that sleep of death what dreams may come
When we have shuffled off this mortal coil,
Must give us pause: there's the respect
That makes calamity of so long life;
For who would bear the whips and scorns of time,
The oppressor's wrong, the proud man's contumely,
The pangs of despised love, the law's delay,
The insolence of office and the spurns
That patient merit of the unworthy takes,
When he himself might his quietus make
With a bare bodkin? Who would fardels bear,
To grunt and sweat under a weary life,
But that the dread of something after death,
The undiscover'd country from whose bourn
No traveller returns, puzzles the will
And makes us rather bear those ills we have
Than fly to others that we know not of?
Thus conscience does make cowards of us all;
And thus the native hue of resolution
Is sicklied o'er with the pale cast of thought,
And enterprises of great pith and moment
With this regard their currents turn awry,
And lose the name of action.--Soft you now!
The fair Ophelia! Nymph, in thy orisons
Be all my sins remember'd. 
		</keylabel>
		<keyalgorithm>RSA</keyalgorithm>
		<keyaccesstype>Extractable</keyaccesstype>
		<serveroom>0</serveroom>
		<passphrase>pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.1.5.6,Add a DSA key</actionname>
	<actiontype>addkey</actiontype>
	<actionbody>
		<keyusage>DSAUsage</keyusage>
		<keysize>512</keysize>
		<keylabel>carrot</keylabel>
		<keyalgorithm>DSA</keyalgorithm>
		<keyaccesstype>Extractable</keyaccesstype>
		<serveroom>1</serveroom>
		<passphrase>pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.1.5.7,Add a DH key</actionname>
	<actiontype>addkey</actiontype>
	<actionbody>
		<keyusage>Derive</keyusage>
		<keysize>512</keysize>
		<keylabel>mango</keylabel>
		<keyalgorithm>DH</keyalgorithm>
		<keyaccesstype>Extractable</keyaccesstype>
		<serveroom>1</serveroom>
		<passphrase>pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.1.5.7.1,Open it</actionname>
	<actiontype>open</actiontype>
	<actionbody>
		<keylabel>mango</keylabel>
		<open>DH</open>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.1.5.7.2, Test derive</actionname>
	<actiontype>derive</actiontype>
	<actionbody>
		<keylabel>mango</keylabel>
		<n>DA9A18547FF03B385CC16508C173A7EF4EB61CB40EF8FEF3B31F145051676166BCDC3FE6B799FC394D08C26385F9413F896E09117E46209D6923602683CEA100924A6EE695281775C619DAA94EA8CB3691B4275B0183F1D39639EBC92995FE645D6C1BC28D409E585549BBD2C5DCDD6C208B04EADD8B7A6D997F72CBAD88390F</n>
		<g>02</g>
		<serveroom>1</serveroom>
		<passphrase>pinkcloud</passphrase>
		<passphrase>pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.1.6,Add a key with illegal usage</actionname>
	<actiontype>addkey</actiontype>
	<actionbody>
		<keyusage>Sign</keyusage>
		<keysize>512</keysize>
		<keylabel>jackfruit</keylabel>
		<keyalgorithm>DH</keyalgorithm>
		<keyaccesstype>Extractable</keyaccesstype>
		<passphrase>pinkcloud</passphrase>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.1.7,Add a key with illegal usage</actionname>
	<actiontype>addkey</actiontype>
	<actionbody>
		<keyusage>Derive</keyusage>
		<keysize>512</keysize>
		<keylabel>custard apple</keylabel>
		<keyalgorithm>DSA</keyalgorithm>
		<keyaccesstype>Extractable</keyaccesstype>
		<passphrase>pinkcloud</passphrase>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.1.8,Add a key with illegal usage</actionname>
	<actiontype>addkey</actiontype>
	<actionbody>
		<keyusage>Sign</keyusage>
		<keyusage>NR</keyusage>
		<keyusage>Derive</keyusage>
		<keysize>512</keysize>
		<keylabel>grape</keylabel>
		<keyalgorithm>DSA</keyalgorithm>
		<keyaccesstype>Extractable</keyaccesstype>
		<passphrase>pinkcloud</passphrase>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.2 List everything (including illegal usage keys)</actionname>
	<actiontype>listkeys</actiontype>
	<actionbody>
		<listcount>7</listcount>
		<foundkey>carrot</foundkey>
		<foundkey>mango</foundkey>
		<foundkey>
To be, or not to be: that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take arms against a sea of troubles,
And by opposing end them? To die: to sleep;
No more; and by a sleep to say we end
The heart-ache and the thousand natural shocks
That flesh is heir to, 'tis a consummation
Devoutly to be wish'd. To die, to sleep;
To sleep: perchance to dream: ay, there's the rub;
For in that sleep of death what dreams may come
When we have shuffled off this mortal coil,
Must give us pause: there's the respect
That makes calamity of so long life;
For who would bear the whips and scorns of time,
The oppressor's wrong, the proud man's contumely,
The pangs of despised love, the law's delay,
The insolence of office and the spurns
That patient merit of the unworthy takes,
When he himself might his quietus make
With a bare bodkin? Who would fardels bear,
To grunt and sweat under a weary life,
But that the dread of something after death,
The undiscover'd country from whose bourn
No traveller returns, puzzles the will
And makes us rather bear those ills we have
Than fly to others that we know not of?
Thus conscience does make cowards of us all;
And thus the native hue of resolution
Is sicklied o'er with the pale cast of thought,
And enterprises of great pith and moment
With this regard their currents turn awry,
And lose the name of action.--Soft you now!
The fair Ophelia! Nymph, in thy orisons
Be all my sins remember'd. 
		</foundkey>
		<foundkey>jackfruit</foundkey>
		<foundkey>custard apple</foundkey>
		<foundkey>grape</foundkey>
	<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.3.1 List DSA keys (including illegal usage keys)</actionname>
	<actiontype>listkeys</actiontype>
	<actionbody>
		<keyalgorithm>DSA</keyalgorithm>
		<listcount>3</listcount>
		<foundkey>carrot</foundkey>
		<foundkey>custard apple</foundkey>
		<foundkey>grape</foundkey>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.3.2 List Sign-usage keys (including illegal usage keys)</actionname>
	<actiontype>listkeys</actiontype>
	<actionbody>
		<keyusage>DSAUsage</keyusage>
		<listcount>5</listcount>
		<foundkey>bigbanana</foundkey>
		<foundkey>
To be, or not to be: that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take arms against a sea of troubles,
And by opposing end them? To die: to sleep;
No more; and by a sleep to say we end
The heart-ache and the thousand natural shocks
That flesh is heir to, 'tis a consummation
Devoutly to be wish'd. To die, to sleep;
To sleep: perchance to dream: ay, there's the rub;
For in that sleep of death what dreams may come
When we have shuffled off this mortal coil,
Must give us pause: there's the respect
That makes calamity of so long life;
For who would bear the whips and scorns of time,
The oppressor's wrong, the proud man's contumely,
The pangs of despised love, the law's delay,
The insolence of office and the spurns
That patient merit of the unworthy takes,
When he himself might his quietus make
With a bare bodkin? Who would fardels bear,
To grunt and sweat under a weary life,
But that the dread of something after death,
The undiscover'd country from whose bourn
No traveller returns, puzzles the will
And makes us rather bear those ills we have
Than fly to others that we know not of?
Thus conscience does make cowards of us all;
And thus the native hue of resolution
Is sicklied o'er with the pale cast of thought,
And enterprises of great pith and moment
With this regard their currents turn awry,
And lose the name of action.--Soft you now!
The fair Ophelia! Nymph, in thy orisons
Be all my sins remember'd. 
		</foundkey>
		<foundkey>carrot</foundkey>
		<foundkey>jackfruit</foundkey>
		<foundkey>grape</foundkey>
	<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.3.3 List 'All usages' keys (including illegal usage keys)</actionname>
	<actiontype>listkeys</actiontype>
	<actionbody>
		<keyusage>allusagesbutNR</keyusage>
		<listcount>5</listcount>
		<foundkey>bigbanana</foundkey>
		<foundkey>
To be, or not to be: that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take arms against a sea of troubles,
And by opposing end them? To die: to sleep;
No more; and by a sleep to say we end
The heart-ache and the thousand natural shocks
That flesh is heir to, 'tis a consummation
Devoutly to be wish'd. To die, to sleep;
To sleep: perchance to dream: ay, there's the rub;
For in that sleep of death what dreams may come
When we have shuffled off this mortal coil,
Must give us pause: there's the respect
That makes calamity of so long life;
For who would bear the whips and scorns of time,
The oppressor's wrong, the proud man's contumely,
The pangs of despised love, the law's delay,
The insolence of office and the spurns
That patient merit of the unworthy takes,
When he himself might his quietus make
With a bare bodkin? Who would fardels bear,
To grunt and sweat under a weary life,
But that the dread of something after death,
The undiscover'd country from whose bourn
No traveller returns, puzzles the will
And makes us rather bear those ills we have
Than fly to others that we know not of?
Thus conscience does make cowards of us all;
And thus the native hue of resolution
Is sicklied o'er with the pale cast of thought,
And enterprises of great pith and moment
With this regard their currents turn awry,
And lose the name of action.--Soft you now!
The fair Ophelia! Nymph, in thy orisons
Be all my sins remember'd. 
		</foundkey>
		<foundkey>carrot</foundkey>
		<foundkey>jackfruit</foundkey>
		<foundkey>grape</foundkey>
	<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.4.1, Delete RSA keys</actionname>
	<actiontype>deletekeys</actiontype>
	<actionbody>
		<keyalgorithm>RSA</keyalgorithm>
		<deletecount>2</deletecount>
	<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.4.2 List RSA keys</actionname>
	<actiontype>listkeys</actiontype>
	<actionbody>
		<keyalgorithm>RSA</keyalgorithm>
		<listcount>0</listcount>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.4.3 List everything (including illegal usage keys)</actionname>
	<actiontype>listkeys</actiontype>
	<actionbody>
		<listcount>5</listcount>
		<foundkey>carrot</foundkey>
		<foundkey>mango</foundkey>
		<foundkey>jackfruit</foundkey>
		<foundkey>custard apple</foundkey>
		<foundkey>grape</foundkey>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.4.4,Add a key that was previously deleted</actionname>
	<actiontype>addkey</actiontype>
	<actionbody>
		<keyusage>allusagesbutNR</keyusage>
		<keysize>512</keysize>
		<keylabel>banana</keylabel>
		<keyalgorithm>RSA</keyalgorithm>
		<keyaccesstype>Extractable</keyaccesstype>
		<serveroom>0</serveroom>
		<passphrase>pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.4.5 List RSA keys (including illegal usage keys)</actionname>
	<actiontype>listkeys</actiontype>
	<actionbody>
		<keyalgorithm>RSA</keyalgorithm>
		<listcount>1</listcount>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.4.6 List everything (including illegal usage keys)</actionname>
	<actiontype>listkeys</actiontype>
	<actionbody>
		<listcount>6</listcount>
		<foundkey>carrot</foundkey>
		<foundkey>mango</foundkey>
		<foundkey>banana</foundkey>
		<foundkey>jackfruit</foundkey>
		<foundkey>custard apple</foundkey>
		<foundkey>grape</foundkey>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

////////////////////////////////////////////////////////////////////////////////
// Test RSA signing
////////////////////////////////////////////////////////////////////////////////

<action>
	<actionname>1.0.0.2.1,Open it</actionname>
	<actiontype>open</actiontype>
	<actionbody>
		<keylabel>banana</keylabel>
		<open>RSA</open>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.0.0.2.2,Open a banana for decrypt</actionname>
	<actiontype>open</actiontype>
	<actionbody>
		<keylabel>banana</keylabel>
		<open>Decrypt</open>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Decrypt</actionname>
	<actiontype>decrypt</actiontype>
	<actionbody>
		<keylabel>banana</keylabel>
		<text>Ook!</text>
		<serveroom>1</serveroom>
		<passphrase>pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.0.0.2.2.1, Sign with a banana, 20 char text</actionname>
	<actiontype>sign</actiontype>
	<actionbody>
		<keylabel>banana</keylabel>
		<open>RSA</open>
		<text>This is text of 20 .</text>
		<serveroom>1</serveroom>
		<passphrase>pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.0.0.2.2.2, Sign with a banana, 32 char text</actionname>
	<actiontype>sign</actiontype>
	<actionbody>
		<keylabel>banana</keylabel>
		<open>RSA</open>
		<text>This is text of thirty-two chars</text>
		<serveroom>1</serveroom>
		<passphrase>pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.0.0.2.2.2.1, Sign digest with a banana</actionname>
	<actiontype>sign</actiontype>
	<actionbody>
		<keylabel>banana</keylabel>
		<open>RSA</open>
		<signdigest>1</signdigest>
		<text>digested!</text>
		<serveroom>1</serveroom>
		<passphrase>pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.4.5, Delete it again</actionname>
	<actiontype>deletekeys</actiontype>
	<actionbody>
		<keyalgorithm>RSA</keyalgorithm>
		<deletecount>1</deletecount>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

////////////////////////////////////////////////////////////////////////////////
// Test DSA signing
////////////////////////////////////////////////////////////////////////////////

<action>
	<actionname>1.0.0.10,Get carrot</actionname>
	<actiontype>getkeyinfo</actiontype>
	<actionbody>
		<keyusage>DSAUsage</keyusage>
		<keysize>512</keysize>
		<keylabel>carrot</keylabel>
		<keyalgorithm>DSA</keyalgorithm>
		<keyaccesstype>Extractable</keyaccesstype>
		<keyaccesstype>Local</keyaccesstype>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>


<action>
	<actionname>1.0.0.10.1, Sign with a carrot, 20 char text</actionname>
	<actiontype>sign</actiontype>
	<actionbody>
		<keylabel>carrot</keylabel>
		<open>DSA</open>
		<text>This is text of 20 .</text>
		<serveroom>1</serveroom>
		<passphrase>pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.0.0.10.2, Sign with carrot, text too long (21 chars)</actionname>
	<actiontype>sign</actiontype>
	<actionbody>
		<keylabel>carrot</keylabel>
		<open>DSA</open>
		<text>This is a text of 21.</text>
	</actionbody>
	<actionresult>
		<return>KErrOverflow</return>
	</actionresult>
</action>

<action>
	<actionname>1.0.0.10.2, Sign digest with carrot</actionname>
	<actiontype>sign</actiontype>
	<actionbody>
		<keylabel>carrot</keylabel>
		<open>DSA</open>
		<signdigest>1</signdigest>
		<passphrase>pinkcloud</passphrase>
		<text>Had we but world enough, and time,
This coyness, lady, were no crime.
We would sit down and think which way
To walk, and pass our long love's day;
Thou by the Indian Ganges' side
Shouldst rubies find; I by the tide
Of Humber would complain. I would
Love you ten years before the Flood;
And you should, if you please, refuse
Till the conversion of the Jews.
My vegetable love should grow
Vaster than empires, and more slow.
An hundred years should go to praise
Thine eyes, and on thy forehead gaze;
Two hundred to adore each breast,
But thirty thousand to the rest;
An age at least to every part,
And the last age should show your heart.
For, lady, you deserve this state,
Nor would I love at lower rate.

        But at my back I always hear
Time's winged chariot hurrying near;
And yonder all before us lie
Deserts of vast eternity.
Thy beauty shall no more be found,
Nor, in thy marble vault, shall sound
My echoing song; then worms shall try
That long preserv'd virginity,
And your quaint honour turn to dust,
And into ashes all my lust.
The grave's a fine and private place,
But none I think do there embrace.

        Now therefore, while the youthful hue
Sits on thy skin like morning dew,
And while thy willing soul transpires
At every pore with instant fires,
Now let us sport us while we may;
And now, like am'rous birds of prey,
Rather at once our time devour,
Than languish in his slow-chapp'd power.
Let us roll all our strength, and all
Our sweetness, up into one ball;
And tear our pleasures with rough strife
Thorough the iron gates of life.
Thus, though we cannot make our sun
Stand still, yet we will make him run</text>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.0.0.10.3, Sign digest with a carrot, fail hash</actionname>
	<actiontype>sign</actiontype>
	<actionbody>
		<keylabel>carrot</keylabel>
		<open>DSA</open>
		<signdigest>2</signdigest>
		<text>digest!</text>
		<passphrase>pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrGeneral</return>
	</actionresult>
</action>

<action>
	<actionname>1.4.5, Delete it again</actionname>
	<actiontype>deletekeys</actiontype>
	<actionbody>
		<keyalgorithm>DSA</keyalgorithm>
		<deletecount>3</deletecount>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.5.8.1 List everything (including illegal usage keys)</actionname>
	<actiontype>listkeys</actiontype>
	<actionbody>
		<listcount>2</listcount>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.5.8.2, Delete everything</actionname>
	<actiontype>deletekeys</actiontype>
	<actionbody>
		<deletecount>2</deletecount>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.5.9 List everything</actionname>
	<actiontype>listkeys</actiontype>
	<actionbody>
		<listcount>0</listcount>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

// Test importing keys

<action>
<actionname>26, Import a PKCS5 encrypted DSA key</actionname>
	<actiontype>importkey</actiontype>
	<actionbody>
		<ImportData>encryptPK8dsa4DER.txt</ImportData>
		<keyusage>DSAUsage</keyusage>
		<keylabel>*IMPORTED* encrypted purple plum</keylabel>
		<keyaccesstype>Extractable</keyaccesstype>
		<passphrase>import clanger</passphrase>
		<passphrase>create pinkcloud</passphrase>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>27, List DSA keys (TEST ID: GT0140-KEY001)</actionname>
	<actiontype>listkeys</actiontype>
	<actionbody>
		<keyalgorithm>DSA</keyalgorithm>
		<listcount>1</listcount>
		<foundkey>*IMPORTED* encrypted purple plum</foundkey>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>28, Delete everything</actionname>
	<actiontype>deletekeys</actiontype>
	<actionbody>
		<deletecount>1</deletecount>		
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

// Test exporting keys

<action>
<actionname>1.1.0 Import a RSA key</actionname>
	<actiontype>importkey</actiontype>
	<actionbody>
		<ImportData>pkcs8rsa.001</ImportData>
		<keyusage>allusagesbutNR</keyusage>
		<keylabel>gm0RSA</keylabel>
		<keyaccesstype>Extractable</keyaccesstype>
		<passphrase>create pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>


<action>
	<actionname>1.1.0.1, Set passphrase timeout to "don't cache"</actionname>
	<actiontype>settimeout</actiontype>
	<actionbody>
		<keylabel>gm0</keylabel>
		<timeout>0</timeout>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>


<action>
<actionname>1.1.5 Export a RSA key</actionname>
	<actiontype>exportkey</actiontype>
	<actionbody>
		<ExportFile>oom_export_pkcs8rsa_0.001</ExportFile>
		<keyusage>allusagesbutNR</keyusage>
		<keylabel>gm0RSA</keylabel>
		<keyalgorithm>RSA</keyalgorithm>
		<encrypted>0</encrypted>
		<passphrase>pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>


<action>
<actionname>1.4.1 Import a DSA key</actionname>
	<actiontype>importkey</actiontype>
	<actionbody>
		<ImportData>pkcs8dsa.001</ImportData>
		<keyusage>DSAUsage</keyusage>
		<keylabel>gm0DSA</keylabel>
		<keyaccesstype>Extractable</keyaccesstype>
		<passphrase>pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>


<action>
<actionname>1.4.6 Export a DSA key</actionname>
	<actiontype>exportkey</actiontype>
	<actionbody>
		<ExportFile>oom_export_pkcs8dsa_0.001</ExportFile>
		<keyusage>DSAUsage</keyusage>
		<keylabel>gm0DSA</keylabel>
		<keyalgorithm>DSA</keyalgorithm>
		<encrypted>0</encrypted>
		<passphrase>pinkcloud</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>


<action>
<actionname>1.7.6 Export a RSA key in encrypted format</actionname>
	<actiontype>exportkey</actiontype>
	<actionbody>
		<ExportFile>oom_encrypted_export_pkcs8rsa.001</ExportFile>
		<keyusage>allusagesbutNR</keyusage>
		<keylabel>gm0RSA</keylabel>
		<keyalgorithm>RSA</keyalgorithm>
		<encrypted>1</encrypted>
		<passphrase>pinkcloud</passphrase>
		<passphrase>export clanger</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>


<action>
<actionname>1.9.6 Export a DSA key in encrypted format</actionname>
	<actiontype>exportkey</actiontype>
	<actionbody>
		<ExportFile>oom_encrypted_export_pkcs8dsa.001</ExportFile>
		<keyusage>DSAUsage</keyusage>
		<keylabel>gm0DSA</keylabel>
		<keyalgorithm>DSA</keyalgorithm>
		<encrypted>1</encrypted>
		<passphrase>pinkcloud</passphrase>
		<passphrase>export clanger</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.10.0 NOT A TEST Delete everything 
                    ** Basic sanity check for PKCS8 encrypted DSA key import/export **</actionname>
	<actiontype>deletekeys</actiontype>
	<actionbody></actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>


// Test authentication objects (snippets of authobjects.txt)

<action>
	<actionname>2.1, Add a key</actionname>
	<actiontype>addkey</actiontype>
	<actionbody>
		<keyusage>allusagesbutNR</keyusage>
		<keysize>512</keysize>
		<keylabel>banana</keylabel>
		<keyalgorithm>RSA</keyalgorithm>
		<keyaccesstype>Extractable</keyaccesstype>
		<passphrase>create flyingelephant</passphrase>
		<serveroom>0</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>2.2, List protected objects</actionname>
	<actiontype>listprotectedobjects</actiontype>
	<actionbody>
		<keylabel>banana</keylabel>
		<foundkey>banana</foundkey>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>3.5, Change the passphrase</actionname>
	<actiontype>changepassphrase</actiontype>
	<actionbody>
		<keylabel>banana</keylabel>
		<passphrase>change flyingelephant redfox</passphrase>
		<serveroom>1</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>



<action>
	<actionname>0.7.2, Set passphrase timeout to 15 seconds</actionname>
	<actiontype>settimeout</actiontype>
	<actionbody>
		<keylabel>banana</keylabel>
		<timeout>15</timeout>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.1.2, Get timeout, expect 15 seconds</actionname>
	<actiontype>gettimeout</actiontype>
	<actionbody>
		<keylabel>banana</keylabel>
		<timeout>15</timeout>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.4.1.5, Open banana</actionname>
	<actiontype>authopen</actiontype>
	<actionbody>
		<keylabel>banana</keylabel>
		<passphrase>redfox</passphrase>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.3.1, Get time remaining, expect 15 seconds</actionname>
	<actiontype>timeremaining</actiontype>
	<actionbody>
		<keylabel>banana</keylabel>
		<timeout>15</timeout>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>1.4.2.2, Close object</actionname>
	<actiontype>authclose</actiontype>
	<actionbody>
		<keylabel>banana</keylabel>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>3.8, Delete everything</actionname>
	<actiontype>deletekeys</actiontype>
	<actionbody>
		<deletecount>1</deletecount>
		<serveroom>0</serveroom>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

// End of testing

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

<action>
	<actionname>Stop server OOM testing</actionname>
	<actiontype>stopserveroom</actiontype>
</action>

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

<action>
	<actionname>999.3, Check for server heap error</actionname>
	<actiontype>checkserverheaperror</actiontype>
	<actionbody>
    </actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>
