1 Reply Latest reply: Jan 11, 2013 10:37 AM by Hana Bizhani RSS

    encypt/decrypt APDU

    Valentino
      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