[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-jce] JCE 2.51: array exception when decrypting PKCS12 with certain wrong passwords



While writing code to catch exceptions thrown by PKCS12.decrypt when the
password is incorrect, I've found that some wrong passwords throw this
exception:

java.lang.ArrayIndexOutOfBoundsException
        at iaik.asn1.ConstructedType.getComponentAt(Unknown Source)
        at iaik.pkcs.pkcs8.PrivateKeyInfo.getPrivateKey(Unknown Source)
        at iaik.pkcs.pkcs8.PrivateKeyInfo.getPrivateKey(Unknown Source)
        at iaik.pkcs.pkcs8.EncryptedPrivateKeyInfo.decrypt(Unknown Source)
        at iaik.pkcs.pkcs12.PKCS8ShroudedKeyBag.decrypt(Unknown Source)
        at iaik.pkcs.pkcs12.AuthenticatedSafe.decrypt(Unknown Source)
        at iaik.pkcs.pkcs12.PKCS12.decrypt(Unknown Source)

whereas others throw

iaik.pkcs.PKCSException: Unable to decrypt PrivateKey!
        at iaik.pkcs.pkcs12.AuthenticatedSafe.decrypt(Unknown Source)
        at iaik.pkcs.pkcs12.PKCS12.decrypt(Unknown Source)

-- Richard
----------------------------------------------------------------------------
----
This email and any files transmitted with it are intended solely for the
addressee(s) and may be legally privileged and/or confidential. If you have
received this email in error please destroy it and contact the sender, via
our switchboard on +44 (0)20 7623 8000 or via return e-mail. You should not
copy, forward or use the contents, attachments or information in any way.
Any unauthorised use or disclosure may be unlawful. Dresdner Kleinwort
Benson gives no warranty as to the accuracy or completeness of this email
after it is sent over the Internet and accepts no responsibility for changes
made after it was sent. Any opinion expressed in this email may be personal
to the author and may not necessarily reflect the opinions of the Bank or
its affiliates. They may also be subject to change without notice.
----------------------------------------------------------------------------
----

--------------------------------------------------------------------------------
This email and any files transmitted with it are intended solely for the
addressee(s) and may be legally privileged and/or confidential. If you have
received this email in error please destroy it and contact the sender, via
our switchboard on +44 (0)20 7623 8000 or via return e-mail. You should not
copy, forward or use the contents, attachments or information in any way.
Any unauthorised use or disclosure may be unlawful. Dresdner Kleinwort
Benson gives no warranty as to the accuracy or completeness of this email
after it is sent over the Internet and accepts no responsibility for changes
made after it was sent. Any opinion expressed in this email may be personal
to the author and may not necessarily reflect the opinions of the Bank or
its affiliates. They may also be subject to change without notice.
--------------------------------------------------------------------------------

--
Mailinglist-archive at http://jcewww.iaik.at/mailarchive/iaik-jce/jcethreads.html

To unsubscribe send an email to listserv@iaik.at with the folowing content: UNSUBSCRIBE iaik-jce