checkIsConstructed(derAlgorithmID, "Wrong subjectPublicKey field");
DerUtil.checkIsConstructed(derAlgorithmID, "Wrong subjectPublicKey field");
  public PublicKey decodePublicKey(byte[] input)  {    if (input == null)      throw new InvalidParameterException("Input bytes MUST NOT be null");    BigInteger n, e;    DERReader der = new DERReader(input);    try      {        DERValue derSPKI = der.read();        checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field");        DERValue derAlgorithmID = der.read();        checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field");        DERValue derOID = der.read();        if (! (derOID.getValue() instanceof OID))          throw new InvalidParameterException("Wrong Algorithm field");        OID algOID = (OID) derOID.getValue();        if (! algOID.equals(RSA_ALG_OID))          throw new InvalidParameterException("Unexpected OID: " + algOID);        DERValue val = der.read();        if (! (val.getValue() instanceof BitString))          throw new InvalidParameterException("Wrong SubjectPublicKey field");        byte[] spkBytes = ((BitString) val.getValue()).toByteArray();        der = new DERReader(spkBytes);        val = der.read();        checkIsConstructed(derAlgorithmID, "Wrong subjectPublicKey field");        val = der.read();        checkIsBigInteger(val, "Wrong modulus field");        n = (BigInteger) val.getValue();        val = der.read();        checkIsBigInteger(val, "Wrong publicExponent field");        e = (BigInteger) val.getValue();      }    catch (IOException x)      {        InvalidParameterException y = new InvalidParameterException();        y.initCause(x);        throw y;      }    return new GnuRSAPublicKey(Registry.X509_ENCODING_ID, n, e);  }