java_src/src/main/java/com/google/crypto/tink/subtle/Validators.java
/**
   * Validates whether {@code publicExponent} is odd and greater than 65536.
   *
   * <p>The primes p and q are chosen such that (p-1)(q-1) is relatively prime to the public
   * exponent. Therefore, the public exponent must be odd. Furthermore, choosing a public exponent
   * which is not greater than 65536 can lead to weak instantiations of RSA. A public exponent which
   * is odd and greater than 65536 conforms to the requirements set by NIST FIPS 186-4
   * (Appendix B.3.1).
   *
   * @throws GeneralSecurityException if {@code publicExponent} is even or not greater than 65536.
   */
Validates whether  publicExponent is odd and greater than 65536.
The primes p and q are chosen such that (p-1)(q-1) is relatively prime to the public
exponent. Therefore, the public exponent must be odd. Furthermore, choosing a public exponent
which is not greater than 65536 can lead to weak instantiations of RSA. A public exponent which
is odd and greater than 65536 conforms to the requirements set by NIST FIPS 186-4
(Appendix B.3.1).

@throws GeneralSecurityException if  publicExponent is even or not greater than 65536.
Validates whether publicExponent is odd and greater than 65536 . The primes p and q are chosen such that ( p - 1 ) ( q - 1 ) is relatively prime to the public exponent . Therefore the public exponent must be odd . Furthermore choosing a public exponent which is not greater than 65536 can lead to weak instantiations of RSA . A public exponent which is odd and greater than 65536 conforms to the requirements set by NIST FIPS 186 - 4 ( Appendix B . 3 . 1 ) . @throws GeneralSecurityException if publicExponent is even or not greater than 65536 .
public static void validateRsaPublicExponent(
      BigInteger publicExponent) throws GeneralSecurityException {
    if (!publicExponent.testBit(0)) {
      throw new GeneralSecurityException("Public exponent must be odd.");
    }
    if (publicExponent.compareTo(BigInteger.valueOf(65536)) <= 0) {
      throw new GeneralSecurityException("Public exponent must be greater than 65536.");
    }
  }
public static void validateRsaPublicExponent ( BigInteger publicExponent ) throws GeneralSecurityException { if ( ! publicExponent . testBit ( 0 ) ) { throw new GeneralSecurityException ( "Public exponent must be odd." ) ; } if ( publicExponent . compareTo ( BigInteger . valueOf ( 65536 ) ) <= 0 ) { throw new GeneralSecurityException ( "Public exponent must be greater than 65536." ) ; } }
Validates whether {@code publicExponent} is odd and greater than 65536.
Validates whether { @code publicExponent } is odd and greater than 65536 .