Skip to Main Content

Java Card

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

encypt/decrypt APDU

ValentinoDec 4 2012 — edited Jan 11 2013
Hi,
here are my commands for encryption
# SELECT PKCS#15 application
# VERIFY USER PIN

# MANAGE SECURITY ENVIRONMENT (select key)
byte keyId = 0x021; // why PrivateKey? I thought encryption is with public key!
new CommandAPDU(0x00, 0x22, 0x41, 0xB8, new byte[]{ (byte)0x84, 0x01, keyId, (byte)0x80, 0x01, 0x00 }); // SW status is 9000

# PSO ENCRYPTION
new CommandAPDU(0x00, 0x2A, 0x86, 0x80, "ThisTextWillBeEncrypted".getBytes() ); // SW status is 6985 - Conditions of use not satisfied
I have the same problem with decryption.
What am I doing wrong? What are the conditions to be satisfied?
Thank you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 8 2013
Added on Dec 4 2012
1 comment
720 views