java_src/src/main/java/com/google/crypto/tink/subtle/Validators.java
/**
   * Validates whether {@code modulusSize} is at least 2048-bit.
   *
   * <p>To reach 128-bit security strength, RSA's modulus must be at least 3072-bit while 2048-bit
   * RSA key only has 112-bit security. Nevertheless, a 2048-bit RSA key is considered safe by NIST
   * until 2030 (see https://www.keylength.com/en/4/).
   *
   * @throws GeneralSecurityException if {@code modulusSize} is less than 2048-bit.
   */
Validates whether  modulusSize is at least 2048-bit.
To reach 128-bit security strength, RSA's modulus must be at least 3072-bit while 2048-bit
RSA key only has 112-bit security. Nevertheless, a 2048-bit RSA key is considered safe by NIST
until 2030 .

@throws GeneralSecurityException if  modulusSize is less than 2048-bit.
Validates whether modulusSize is at least 2048 - bit . To reach 128 - bit security strength RSA ' s modulus must be at least 3072 - bit while 2048 - bit RSA key only has 112 - bit security . Nevertheless a 2048 - bit RSA key is considered safe by NIST until 2030 . @throws GeneralSecurityException if modulusSize is less than 2048 - bit .
public static void validateRsaModulusSize(int modulusSize) throws GeneralSecurityException {
    if (modulusSize < MIN_RSA_MODULUS_SIZE) {
      throw new GeneralSecurityException(
          String.format(
              "Modulus size is %d; only modulus size >= 2048-bit is supported", modulusSize));
    }
    if (TinkFipsUtil.useOnlyFips() && (modulusSize != 3072)) {
      throw new GeneralSecurityException(
          String.format(
              "Modulus size is %d; only modulus size 3072-bit is supported in FIPS mode",
              modulusSize));
    }
  }
public static void validateRsaModulusSize ( int modulusSize ) throws GeneralSecurityException { if ( modulusSize < MIN_RSA_MODULUS_SIZE ) { throw new GeneralSecurityException ( String . format ( "Modulus size is %d; only modulus size >= 2048-bit is supported" , modulusSize ) ) ; } if ( TinkFipsUtil . useOnlyFips ( ) && ( modulusSize != 3072 ) ) { throw new GeneralSecurityException ( String . format ( "Modulus size is %d; only modulus size 3072-bit is supported in FIPS mode" , modulusSize ) ) ; } }
Validates whether {@code modulusSize} is at least 2048-bit.
Validates whether { @code modulusSize } is at least 2048 - bit .
// In FIPS only mode we check here if the modulus is 3072, as this is the // only size which is covered by the FIPS validation and supported by Tink. // See // https://csrc.nist.gov/projects/cryptographic-module-validation-program/certificate/3318