5297N/A * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * The JCE security manager. 0N/A * <p>The JCE security manager is responsible for determining the maximum 0N/A * algorithm, by consulting the configured jurisdiction policy files and 0N/A * <p>Note that this security manager is never installed, only instantiated. 0N/A // singleton instance 0N/A * Returns the maximum allowable crypto strength for the given 0N/A // Need to convert to uppercase since the crypto perm 0N/A // lookup is case sensitive. 0N/A // If CryptoAllPermission is granted by default, we return that. 0N/A // Otherwise, this will be the permission we return if anything goes 0N/A // Determine the codebase of the caller of the JCE API. 0N/A // This is the codebase of the first class which is not in 0N/A // javax.crypto.* packages. 0N/A // NOTE: javax.crypto.* package maybe subject to package 0N/A // insertion, so need to check its classloader as well. 0N/A // skip jce classes since they aren't the callers 0N/A // use default permission when the caller is system classes 0N/A // If the app was granted the special CryptoAllPermission, return that. 0N/A // Check if the crypto permissions granted to the app contain a 0N/A // crypto permission for the requested algorithm that does not require 0N/A // any exemption mechanism to be enforced. 0N/A // Return that permission, if present. 0N/A // Check if the jurisdiction file for exempt applications contains 0N/A // any entries for the requested algorithm. 0N/A // If not, return the default permission. 0N/A // In the jurisdiction file for exempt applications, go through the 0N/A // list of CryptoPermission entries for the requested algorithm, and 0N/A // stop at the first entry: 0N/A // - that is implied by the collection of crypto permissions granted 0N/A // - whose exemption mechanism is available from one of the 0N/A // Check if app is exempt, and retrieve the permissions bundled with it 0N/A // Jar verification fails 0N/A * Returns the default permission for the given algorithm. 0N/A // See bug 4341369 & 4334690 for more info. 0N/A // Get the caller and its codebase. 0N/A // The caller is in the JCE framework. 0N/A //The caller has been verified. 0N/A // Check whether the caller is a trusted provider.