I use the following code to encrypt a SecretKey with password-based 
encryption:

Cipher pbeEncryptCipher = Cipher.getInstance("PBEWithMD5AndDES");          
      

pbeEncryptCipher.init(Cipher.WRAP_MODE, pbeKey, pbeParamSpec);   

byte[] symKeyBytes = null;

try {

        symKeyBytes = pbeEncryptCipher.wrap(key);

}

catch (Exception e2) { Log.v("tag", "encrypt: " + e2.toString()); }

In Android 4.2, but not in any previous version as far as I can tell, this 
throws a java.lang.UnsupportedOperationException. My understanding is that 
this is the result of something missing from the cryptographic service 
provider in Android 4.2, which was not missing in previous versions, ie an 
Android bug. 


Please advise if my understanding is incorrect, otherwise maybe Google 
could fix this? There doesn't seem to be a work-around.


TIA,


Matthew Fleming, MD

DermVision, LLC

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to