Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*************************************************************************
* *
* EJBCA Community: The OpenSource Certificate Authority *
* *
* This software is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or any later version. *
* *
* See terms of license at gnu.org. *
* *
*************************************************************************/
package org.cesecore.keybind;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import org.apache.log4j.Logger;
import org.cesecore.keybind.impl.AuthenticationKeyBinding;
import org.cesecore.keybind.impl.OcspKeyBinding;
import org.cesecore.util.ui.DynamicUiProperty;
/**
* Factory class with an internal registry of known implementations.
*
* @version $Id: InternalKeyBindingFactory.java 23648 2016-06-09 15:19:55Z mikekushner $
*/
public enum InternalKeyBindingFactory {
INSTANCE;
private final Logger log = Logger.getLogger(InternalKeyBindingFactory.class);
private final Map aliasToImplementationMap = new HashMap();
private final Map implementationToAliasMap = new HashMap();
private final Map>> implementationPropertiesMap = new HashMap>>();
private InternalKeyBindingFactory() {
addImplementation(OcspKeyBinding.class);
addImplementation(AuthenticationKeyBinding.class);
// Use ServiceLoader framework to find additional available implementations
// We add these after the built in ones, so the built in implementations can be overridden
// TODO the above when we need to
}
public boolean existsTypeAlias(String alias) {
return aliasToImplementationMap.containsKey(alias);
}
/**
* Creates a new InternalKeyBinding instance.
*
* @param type is the alias of the registered InternalKeyBinding's type
* @param id is the unique identifier of this InternalKeyBinding
* @param name is the unique name that this InternalKeyBinding will be given
* @param status the initial status to give the InternalKeyBinding
* @param certificateId is the certificate fingerprint (lower case) matching the mapped key pair or null
* @param cryptoTokenId is the CryptoToken id of the container where the mapped key pair is stored
* @param keyPairAlias is the alias of the mapped key pair in the specified CryptoToken (may not be null)
* @param dataMap is a Map of implementation specific properties for this type of IntenalKeyBinding
* @return a new InternalKeyBinding instance
*/
public InternalKeyBinding create(final String type, final int id, final String name, final InternalKeyBindingStatus status,
final String certificateId, final int cryptoTokenId, final String keyPairAlias, final LinkedHashMap