Temp key from a byte array

4/14/2016 11:02:33 AM
Gravatar
Total Posts 33

Temp key from a byte array

I have a temporary key generated starting from some keys in the <span data-scayt_word="hsm" data-scaytid="2">hsm.

 

This temp key is now a byte array. How can I use for encrypt/decrypt?

 

For example:

 

session.EncryptInit(Mechanism.DES_ECB, <span data-scayt_word="KL" data-scaytid="4">KL);

 

needs a Key object for "<span data-scayt_word="KL" data-scaytid="8">KL". How can I use my byte array to create a Key object without storing it? Is it (or other <span data-scayt_word="workarouds" data-scaytid="24">workarouds) possible? How?

5/6/2016 12:02:17 PM
Gravatar
Total Posts 30

Re: Temp key from a byte array

To export a private key as encrypted key, you should use the method <span data-scayt_word="WrapKey" data-scaytid="1">WrapKey