DERValue derSignature = der.read(); if (! (derSignature.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong signature field");  byte[] sBytes = ((BitString) derSignature.getValue()).toByteArray(); der = new DERReader(sBytes);
  public Object decodeSignature(byte[] input)  {    if (input == null)      throw new InvalidParameterException("Input bytes MUST NOT be null");    BigInteger r, s;    DERReader der = new DERReader(input);    try      {        DERValue derSignature = der.read();        if (! (derSignature.getValue() instanceof BitString))          throw new InvalidParameterException("Wrong signature field");        byte[] sBytes = ((BitString) derSignature.getValue()).toByteArray();        der = new DERReader(sBytes);        DERValue derDssSigValue = der.read();        DerUtil.checkIsConstructed(derDssSigValue, "Wrong Dss-Sig-Value field");        DERValue val = der.read();        DerUtil.checkIsBigInteger(val, "Wrong R field");        r = (BigInteger) val.getValue();        val = der.read();        DerUtil.checkIsBigInteger(val, "Wrong S field");        s = (BigInteger) val.getValue();      }    catch (IOException x)      {        InvalidParameterException y = new InvalidParameterException();        y.initCause(x);        throw y;      }    return new BigInteger[] { r, s };  }