Extrahieren Sie die Schlüsselwertform HSMJava

Java-Forum
Anonymous
 Extrahieren Sie die Schlüsselwertform HSM

Post by Anonymous »

ein

Code: Select all

    public long Find_AES_Key(String label) {
long hkey = -1L;
try {
AESSecretKey keyTemplate = new AESSecretKey();
keyTemplate.getLabel().setCharArrayValue(label.toCharArray());
CK_ATTRIBUTE[] attributes = iaik.pkcs.pkcs11.objects.Object.getSetAttributes(keyTemplate);

cryptoki.C_FindObjectsInit(ckiSession, attributes, false);
long[] found = cryptoki.C_FindObjects(ckiSession, 1L);
cryptoki.C_FindObjectsFinal(ckiSession);

hkey = found[0];
// cryptoki.C_GetAttributeValue(ckiSession, hkey, attributes, true);

}catch(Exception e) {
e.printStackTrace();
}
return hkey;
}
Vielen Dank für Ihre Hilfe.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post