diff -r 6773349693eb -r cdfdb9c0590e jdk/src/share/classes/sun/security/rsa/RSAPublicKeyImpl.java --- a/jdk/src/share/classes/sun/security/rsa/RSAPublicKeyImpl.java Thu Aug 08 12:03:04 2013 -0700 +++ b/jdk/src/share/classes/sun/security/rsa/RSAPublicKeyImpl.java Thu Aug 08 17:06:40 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,9 +67,10 @@ DerOutputStream out = new DerOutputStream(); out.putInteger(n); out.putInteger(e); - DerValue val = - new DerValue(DerValue.tag_Sequence, out.toByteArray()); - key = val.toByteArray(); + byte[] keyArray = + new DerValue(DerValue.tag_Sequence, + out.toByteArray()).toByteArray(); + setKey(new BitArray(keyArray.length*8, keyArray)); } catch (IOException exc) { // should never occur throw new InvalidKeyException(exc); @@ -104,7 +105,7 @@ */ protected void parseKeyBits() throws InvalidKeyException { try { - DerInputStream in = new DerInputStream(key); + DerInputStream in = new DerInputStream(getKey().toByteArray()); DerValue derValue = in.getDerValue(); if (derValue.tag != DerValue.tag_Sequence) { throw new IOException("Not a SEQUENCE");