robe-auth/src/main/java/io/robe/auth/token/TokenAuthBundle.java
public static void checkCryptography(TokenBasedAuthConfiguration configuration)  {
        try {
            Field field = Class.forName("javax.crypto.JceSecurity").getDeclaredField("isRestricted");
            field.setAccessible(true);
            field.set(null, java.lang.Boolean.FALSE);
        } catch (ClassNotFoundException e) {
            StringBuilder builder = new StringBuilder("javax.crypto.JceSecurity class not found !\n" );
            builder.append(getUpgradJceErrorMessage());
            throw new RuntimeException(builder.toString(), e);
        } catch (final IllegalAccessException | NoSuchFieldException e) {
            try {
                if(BasicToken.getEncryptor().isInitialized()) {
                    BasicToken.getEncryptor().encrypt("Sample Data");
                }
            } catch (EncryptionOperationNotPossibleException ex) {
                StringBuilder builder = new StringBuilder();
                builder
                        .append(configuration.getAlgorithm())
                        .append(" not exist on Java Cryptography Extension (JCE)")
                        .append(getUpgradJceErrorMessage());
                LOGGER.error(builder.toString());
                throw new RuntimeException(builder.toString(), ex);
            }
        }
    }
public static void checkCryptography(TokenBasedAuthConfiguration configuration)  {
        try {
            Field field = Class.forName("javax.crypto.JceSecurity").getDeclaredField("isRestricted");
            field.setAccessible(true);
            field.set(null, java.lang.Boolean.FALSE);
        } catch (ClassNotFoundException e) {
            StringBuilder builder = new StringBuilder("javax.crypto.JceSecurity class not found !\n" );
            builder.append(getUpgradJceErrorMessage());
            throw new RuntimeException(builder.toString(), e);
        } catch (final IllegalAccessException | NoSuchFieldException e) {
            try {
                if(BasicToken.getEncryptor().isInitialized()) {
                    BasicToken.getEncryptor().encrypt("Sample Data");
                }
            } catch (EncryptionOperationNotPossibleException ex) {
                StringBuilder builder = new StringBuilder();
                builder
                        .append(configuration.getAlgorithm())
                        .append(" not exist on Java Cryptography Extension (JCE)")
                        .append(getUpgradJceErrorMessage());
                LOGGER.error(builder.toString());
                throw new RuntimeException(builder.toString(), ex);
            }
        }
    }
public static void checkCryptography ( TokenBasedAuthConfiguration configuration ) { try { Field field = Class . forName ( "javax.crypto.JceSecurity" ) . getDeclaredField ( "isRestricted" ) ; field . setAccessible ( true ) ; field . set ( null , java . lang . Boolean . FALSE ) ; } catch ( ClassNotFoundException e ) { StringBuilder builder = new StringBuilder ( "javax.crypto.JceSecurity class not found !\n" ) ; builder . append ( getUpgradJceErrorMessage ( ) ) ; throw new RuntimeException ( builder . toString ( ) , e ) ; } catch ( final IllegalAccessException | NoSuchFieldException e ) { try { if ( BasicToken . getEncryptor ( ) . isInitialized ( ) ) { BasicToken . getEncryptor ( ) . encrypt ( "Sample Data" ) ; } } catch ( EncryptionOperationNotPossibleException ex ) { StringBuilder builder = new StringBuilder ( ) ; builder . append ( configuration . getAlgorithm ( ) ) . append ( " not exist on Java Cryptography Extension (JCE)" ) . append ( getUpgradJceErrorMessage ( ) ) ; LOGGER . error ( builder . toString ( ) ) ; throw new RuntimeException ( builder . toString ( ) , ex ) ; } } }
Determines if cryptography restrictions apply.
Restrictions apply if the value of {@link Cipher#getMaxAllowedKeyLength(String)} returns a value smaller than {@link Integer#MAX_VALUE} if there are any restrictions according to the JavaDoc of the method.
This method is used with the transform <code>"AES/CBC/PKCS5Padding"</code> as this is an often used algorithm that is <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#impl">an implementation requirement for Java SE</a>.

@return <code>true</code> if restrictions apply, <code>false</code> otherwise
Determines if cryptography restrictions apply . Restrictions apply if the value of { @link Cipher#getMaxAllowedKeyLength ( String ) } returns a value smaller than { @link Integer#MAX_VALUE } if there are any restrictions according to the JavaDoc of the method . This method is used with the transform <code > AES / CBC / PKCS5Padding < / code > as this is an often used algorithm that is <a href = https : // docs . oracle . com / javase / 8 / docs / technotes / guides / security / StandardNames . html#impl > an implementation requirement for Java SE< / a > .