Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.security.NoSuchAlgorithmException;

import javax.crypto.Cipher;

public class Main {
    /**
     * Determines if unlimited-strength cryptography is allowed, i.e. if this JRE has then the unlimited strength policy
     * files installed.
     *
     * @return true if unlimited strength cryptography is allowed, otherwise false
     */
    public static boolean isUnlimitedStrengthAllowed() {
        try {
            return Cipher.getMaxAllowedKeyLength("AES") >= 256;
        } catch (NoSuchAlgorithmException e) {
            return false;
        }

    }
}