2362N/A * Copyright (c) 2003, 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 * TemplateManager class. 0N/A * Not all PKCS#11 tokens are created equal. One token may require that one 0N/A * value is specified when creating a certain type of object. Another token 0N/A * may require a different value. Yet another token may only work if the 0N/A * attribute is not specified at all. 0N/A * In order to allow an application to work unmodified with all those 0N/A * different tokens, the SunPKCS11 provider makes the attributes that are 0N/A * specified and their value configurable. Hence, only the SunPKCS11 0N/A * configuration file has to be tweaked at deployment time to allow all 0N/A * existing applications to be used. 0N/A * The template manager is responsible for reading the attribute configuration 0N/A * information and to make it available to the various internal components 0N/A * of the SunPKCS11 provider. 0N/A * @author Andreas Sterbenz 0N/A private final static boolean DEBUG =
false;
0N/A // constant for any operation (either O_IMPORT or O_GENERATE) 0N/A // constant for operation create ("importing" existing key material) 0N/A // constant for operation generate (generating new key material) 0N/A // primitive templates contains the individual template configuration 0N/A // entries from the configuration file 0N/A // composite templates is a cache of the exact configuration template for 0N/A // each specific TemplateKey (no wildcards). the entries are created 0N/A // on demand during first use by compositing all applicable 0N/A // primitive template entries. the result is then stored in this map 0N/A // add a template. Called by Config. 0N/A // Get the attributes for the requested op and combine them with attrs. 0N/A // This is the method called by the implementation to obtain the 0N/A // build a composite template for the given key 0N/A // iterate through primitive templates and add all that apply 0N/A * Nested class representing a template identifier. 0N/A * Nested class representing template attributes. 0N/A * Combine two sets of attributes. The second set has precedence 0N/A * over the first and overrides its settings.