checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field");
DerUtil.checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field");
  public PrivateKey decodePrivateKey(byte[] input)  {    if (input == null)      throw new InvalidParameterException("Input bytes MUST NOT be null");    BigInteger version, p, q, g, x;    DERReader der = new DERReader(input);    try      {        DERValue derPKI = der.read();        checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field");        DERValue derVersion = der.read();        if (! (derVersion.getValue() instanceof BigInteger))          throw new InvalidParameterException("Wrong Version field");        version = (BigInteger) derVersion.getValue();        if (version.compareTo(BigInteger.ZERO) != 0)          throw new InvalidParameterException("Unexpected Version: " + version);        DERValue derAlgoritmID = der.read();        checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field");        DERValue derOID = der.read();        OID algOID = (OID) derOID.getValue();        if (! algOID.equals(DSA_ALG_OID))          throw new InvalidParameterException("Unexpected OID: " + algOID);        DERValue derParams = der.read();        checkIsConstructed(derParams, "Wrong DSS Parameters field");        DERValue val = der.read();        checkIsBigInteger(val, "Wrong P field");        p = (BigInteger) val.getValue();        val = der.read();        checkIsBigInteger(val, "Wrong Q field");        q = (BigInteger) val.getValue();        val = der.read();        checkIsBigInteger(val, "Wrong G field");        g = (BigInteger) val.getValue();        val = der.read();        byte[] xBytes = (byte[]) val.getValue();        x = new BigInteger(1, xBytes);      }    catch (IOException e)      {        InvalidParameterException y = new InvalidParameterException();        y.initCause(e);        throw y;      }    return new DSSPrivateKey(Registry.PKCS8_ENCODING_ID, p, q, g, x);  }