docs: public static int getKeyLength(final PrivateKey privateKey)
  	{
  		int length = -1;
  		if (privateKey == null)
  		{
  			return length;
  		}
  		if (privateKey instanceof RSAPrivateKey)
  		{
  			length = ((RSAPrivateKey)privateKey).getModulus().bitLength();
  		}
  		if (privateKey instanceof DSAPrivateKey)
  		{
  			length = ((DSAPrivateKey)privateKey).getParams().getQ().bitLength();
  		}
  		if (privateKey instanceof ECPrivateKey)
  		{
  			length = ((ECPrivateKey)privateKey).getParams().getCurve().getField().getFieldSize();
  		}
  		return length;
  	}