Re: Load ECDSA private key with version 1.59 and beyond
There's an extra byte on the end of the
encoding. You'll see it if you use:
String privateKey = "MIIBGwIBADCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEA/////wAAAAEAAAAAAAAAAAAAAAD///////////////8wRAQg/////wAAAAEAAAAAAAAAAAAAAAD///////////////wEIFrGNdiqOpPns+u9VXaYhrxlHQawzFOw9jvOPD4n0mBLBEEEaxfR8uEsQkf4vOblY6RA8ncDfYEt6zOg9KE5RdiYwpZP40Li/hp/m47n60p8D54WK84zV2sxXs7LtkBoN79R9QIhAP////8AAAAA//////////+85vqtpxeehPO5ysL8YyVRAgEBBCcwJQIBAQQgQ5Yba7LcVummrWknvTs+3RRxl4Gz/lUCrIoqlGXwy+gB";
ASN1InputStream aIn = new ASN1InputStream(Base64.decode(privateKey));
while ((o = aIn.readObject()) != null)
1.64 won't tolerate the extra data, it does this as since 1.59 came out there have been increasing concerns that improperly constructed ASN.1 data could be used to hide changes else where in a payload, so the parser now checks.