Verify Key
To verify a key:
Register a new key using wrapped/encrypted key bytes on Key Manager server. Use the
registerKey()
method of theKMIPSession
API.string new_unwrapkeyuid = session.registerKey(byte_wrappedkey, algorithm, null, length, unwrapAttribute );
Match the key bytes of new key and wrapped key. Both must be same.
System.out.println("Plain key bytes of key_unwrapkeyuid" +IngrianProvider.byteArray2Hex (session.getKeyBytes(new_unwrapkeyuid))); System.out.println("Plain key bytes of wrappedkey" +wrapped_keybytes);