|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
package sun.security.provider; |
|
|
|
import java.io.*; |
|
import java.net.*; |
|
import java.security.*; |
|
import java.security.cert.Certificate; |
|
import java.security.cert.CertificateFactory; |
|
import java.security.cert.CertificateException; |
|
import java.util.*; |
|
|
|
import sun.misc.IOUtils; |
|
import sun.security.pkcs.EncryptedPrivateKeyInfo; |
|
import sun.security.util.PolicyUtil; |
|
|
|
/** |
|
* This class provides the domain keystore type identified as "DKS". |
|
* DKS presents a collection of separate keystores as a single logical keystore. |
|
* The collection of keystores is specified in a domain configuration file which |
|
* is passed to DKS in a {@link DomainLoadStoreParameter}. |
|
* <p> |
|
* The following properties are supported: |
|
* <dl> |
|
* <dt> {@code keystoreType="<type>"} </dt> |
|
* <dd> The keystore type. </dd> |
|
* <dt> {@code keystoreURI="<url>"} </dt> |
|
* <dd> The keystore location. </dd> |
|
* <dt> {@code keystoreProviderName="<name>"} </dt> |
|
* <dd> The name of the keystore's JCE provider. </dd> |
|
* <dt> {@code keystorePasswordEnv="<environment-variable>"} </dt> |
|
* <dd> The environment variable that stores a keystore password. |
|
* <dt> {@code entryNameSeparator="<separator>"} </dt> |
|
* <dd> The separator between a keystore name prefix and an entry name. |
|
* When specified, it applies to all the entries in a domain. |
|
* Its default value is a space. </dd> |
|
* </dl> |
|
* |
|
* @since 1.8 |
|
*/ |
|
|
|
abstract class DomainKeyStore extends KeyStoreSpi { |
|
|
|
|
|
public static final class DKS extends DomainKeyStore { |
|
String convertAlias(String alias) { |
|
return alias.toLowerCase(Locale.ENGLISH); |
|
} |
|
} |
|
|
|
|
|
private static final String ENTRY_NAME_SEPARATOR = "entrynameseparator"; |
|
private static final String KEYSTORE_PROVIDER_NAME = "keystoreprovidername"; |
|
private static final String KEYSTORE_TYPE = "keystoretype"; |
|
private static final String KEYSTORE_URI = "keystoreuri"; |
|
private static final String KEYSTORE_PASSWORD_ENV = "keystorepasswordenv"; |
|
|
|
|
|
private static final String REGEX_META = ".$|()[{^?*+\\"; |
|
|
|
|
|
private static final String DEFAULT_STREAM_PREFIX = "iostream"; |
|
private int streamCounter = 1; |
|
private String entryNameSeparator = " "; |
|
private String entryNameSeparatorRegEx = " "; |
|
|
|
|
|
private static final String DEFAULT_KEYSTORE_TYPE = |
|
KeyStore.getDefaultType(); |
|
|
|
|
|
private final Map<String, KeyStore> keystores = new HashMap<>(); |
|
|
|
DomainKeyStore() { |
|
} |
|
|
|
// convert an alias to internal form, overridden in subclasses: |
|
|
|
abstract String convertAlias(String alias); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public Key engineGetKey(String alias, char[] password) |
|
throws NoSuchAlgorithmException, UnrecoverableKeyException |
|
{ |
|
AbstractMap.SimpleEntry<String, Collection<KeyStore>> pair = |
|
getKeystoresForReading(alias); |
|
Key key = null; |
|
|
|
try { |
|
String entryAlias = pair.getKey(); |
|
for (KeyStore keystore : pair.getValue()) { |
|
key = keystore.getKey(entryAlias, password); |
|
if (key != null) { |
|
break; |
|
} |
|
} |
|
} catch (KeyStoreException e) { |
|
throw new IllegalStateException(e); |
|
} |
|
|
|
return key; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public Certificate[] engineGetCertificateChain(String alias) { |
|
|
|
AbstractMap.SimpleEntry<String, Collection<KeyStore>> pair = |
|
getKeystoresForReading(alias); |
|
Certificate[] chain = null; |
|
|
|
try { |
|
String entryAlias = pair.getKey(); |
|
for (KeyStore keystore : pair.getValue()) { |
|
chain = keystore.getCertificateChain(entryAlias); |
|
if (chain != null) { |
|
break; |
|
} |
|
} |
|
} catch (KeyStoreException e) { |
|
throw new IllegalStateException(e); |
|
} |
|
|
|
return chain; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public Certificate engineGetCertificate(String alias) { |
|
|
|
AbstractMap.SimpleEntry<String, Collection<KeyStore>> pair = |
|
getKeystoresForReading(alias); |
|
Certificate cert = null; |
|
|
|
try { |
|
String entryAlias = pair.getKey(); |
|
for (KeyStore keystore : pair.getValue()) { |
|
cert = keystore.getCertificate(entryAlias); |
|
if (cert != null) { |
|
break; |
|
} |
|
} |
|
} catch (KeyStoreException e) { |
|
throw new IllegalStateException(e); |
|
} |
|
|
|
return cert; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public Date engineGetCreationDate(String alias) { |
|
|
|
AbstractMap.SimpleEntry<String, Collection<KeyStore>> pair = |
|
getKeystoresForReading(alias); |
|
Date date = null; |
|
|
|
try { |
|
String entryAlias = pair.getKey(); |
|
for (KeyStore keystore : pair.getValue()) { |
|
date = keystore.getCreationDate(entryAlias); |
|
if (date != null) { |
|
break; |
|
} |
|
} |
|
} catch (KeyStoreException e) { |
|
throw new IllegalStateException(e); |
|
} |
|
|
|
return date; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void engineSetKeyEntry(String alias, Key key, char[] password, |
|
Certificate[] chain) |
|
throws KeyStoreException |
|
{ |
|
AbstractMap.SimpleEntry<String, |
|
AbstractMap.SimpleEntry<String, KeyStore>> pair = |
|
getKeystoreForWriting(alias); |
|
|
|
if (pair == null) { |
|
throw new KeyStoreException("Error setting key entry for '" + |
|
alias + "'"); |
|
} |
|
String entryAlias = pair.getKey(); |
|
Map.Entry<String, KeyStore> keystore = pair.getValue(); |
|
keystore.getValue().setKeyEntry(entryAlias, key, password, chain); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void engineSetKeyEntry(String alias, byte[] key, |
|
Certificate[] chain) |
|
throws KeyStoreException |
|
{ |
|
AbstractMap.SimpleEntry<String, |
|
AbstractMap.SimpleEntry<String, KeyStore>> pair = |
|
getKeystoreForWriting(alias); |
|
|
|
if (pair == null) { |
|
throw new KeyStoreException( |
|
"Error setting protected key entry for '" + alias + "'"); |
|
} |
|
String entryAlias = pair.getKey(); |
|
Map.Entry<String, KeyStore> keystore = pair.getValue(); |
|
keystore.getValue().setKeyEntry(entryAlias, key, chain); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void engineSetCertificateEntry(String alias, Certificate cert) |
|
throws KeyStoreException |
|
{ |
|
AbstractMap.SimpleEntry<String, |
|
AbstractMap.SimpleEntry<String, KeyStore>> pair = |
|
getKeystoreForWriting(alias); |
|
|
|
if (pair == null) { |
|
throw new KeyStoreException("Error setting certificate entry for '" |
|
+ alias + "'"); |
|
} |
|
String entryAlias = pair.getKey(); |
|
Map.Entry<String, KeyStore> keystore = pair.getValue(); |
|
keystore.getValue().setCertificateEntry(entryAlias, cert); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void engineDeleteEntry(String alias) throws KeyStoreException |
|
{ |
|
AbstractMap.SimpleEntry<String, |
|
AbstractMap.SimpleEntry<String, KeyStore>> pair = |
|
getKeystoreForWriting(alias); |
|
|
|
if (pair == null) { |
|
throw new KeyStoreException("Error deleting entry for '" + alias + |
|
"'"); |
|
} |
|
String entryAlias = pair.getKey(); |
|
Map.Entry<String, KeyStore> keystore = pair.getValue(); |
|
keystore.getValue().deleteEntry(entryAlias); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public Enumeration<String> engineAliases() { |
|
final Iterator<Map.Entry<String, KeyStore>> iterator = |
|
keystores.entrySet().iterator(); |
|
|
|
return new Enumeration<String>() { |
|
private int index = 0; |
|
private Map.Entry<String, KeyStore> keystoresEntry = null; |
|
private String prefix = null; |
|
private Enumeration<String> aliases = null; |
|
|
|
public boolean hasMoreElements() { |
|
try { |
|
if (aliases == null) { |
|
if (iterator.hasNext()) { |
|
keystoresEntry = iterator.next(); |
|
prefix = keystoresEntry.getKey() + |
|
entryNameSeparator; |
|
aliases = keystoresEntry.getValue().aliases(); |
|
} else { |
|
return false; |
|
} |
|
} |
|
if (aliases.hasMoreElements()) { |
|
return true; |
|
} else { |
|
if (iterator.hasNext()) { |
|
keystoresEntry = iterator.next(); |
|
prefix = keystoresEntry.getKey() + |
|
entryNameSeparator; |
|
aliases = keystoresEntry.getValue().aliases(); |
|
} else { |
|
return false; |
|
} |
|
} |
|
} catch (KeyStoreException e) { |
|
return false; |
|
} |
|
|
|
return aliases.hasMoreElements(); |
|
} |
|
|
|
public String nextElement() { |
|
if (hasMoreElements()) { |
|
return prefix + aliases.nextElement(); |
|
} |
|
throw new NoSuchElementException(); |
|
} |
|
}; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public boolean engineContainsAlias(String alias) { |
|
|
|
AbstractMap.SimpleEntry<String, Collection<KeyStore>> pair = |
|
getKeystoresForReading(alias); |
|
|
|
try { |
|
String entryAlias = pair.getKey(); |
|
for (KeyStore keystore : pair.getValue()) { |
|
if (keystore.containsAlias(entryAlias)) { |
|
return true; |
|
} |
|
} |
|
} catch (KeyStoreException e) { |
|
throw new IllegalStateException(e); |
|
} |
|
|
|
return false; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public int engineSize() { |
|
|
|
int size = 0; |
|
try { |
|
for (KeyStore keystore : keystores.values()) { |
|
size += keystore.size(); |
|
} |
|
} catch (KeyStoreException e) { |
|
throw new IllegalStateException(e); |
|
} |
|
|
|
return size; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public boolean engineIsKeyEntry(String alias) { |
|
|
|
AbstractMap.SimpleEntry<String, Collection<KeyStore>> pair = |
|
getKeystoresForReading(alias); |
|
|
|
try { |
|
String entryAlias = pair.getKey(); |
|
for (KeyStore keystore : pair.getValue()) { |
|
if (keystore.isKeyEntry(entryAlias)) { |
|
return true; |
|
} |
|
} |
|
} catch (KeyStoreException e) { |
|
throw new IllegalStateException(e); |
|
} |
|
|
|
return false; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public boolean engineIsCertificateEntry(String alias) { |
|
|
|
AbstractMap.SimpleEntry<String, Collection<KeyStore>> pair = |
|
getKeystoresForReading(alias); |
|
|
|
try { |
|
String entryAlias = pair.getKey(); |
|
for (KeyStore keystore : pair.getValue()) { |
|
if (keystore.isCertificateEntry(entryAlias)) { |
|
return true; |
|
} |
|
} |
|
} catch (KeyStoreException e) { |
|
throw new IllegalStateException(e); |
|
} |
|
|
|
return false; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
private AbstractMap.SimpleEntry<String, Collection<KeyStore>> |
|
getKeystoresForReading(String alias) { |
|
|
|
String[] splits = alias.split(this.entryNameSeparatorRegEx, 2); |
|
if (splits.length == 2) { |
|
KeyStore keystore = keystores.get(splits[0]); |
|
if (keystore != null) { |
|
return new AbstractMap.SimpleEntry<>(splits[1], |
|
(Collection<KeyStore>) Collections.singleton(keystore)); |
|
} |
|
} else if (splits.length == 1) { // unprefixed alias |
|
|
|
return new AbstractMap.SimpleEntry<>(alias, keystores.values()); |
|
} |
|
return new AbstractMap.SimpleEntry<>("", |
|
(Collection<KeyStore>) Collections.<KeyStore>emptyList()); |
|
} |
|
|
|
|
|
|
|
|
|
*/ |
|
private |
|
AbstractMap.SimpleEntry<String, AbstractMap.SimpleEntry<String, KeyStore>> |
|
getKeystoreForWriting(String alias) { |
|
|
|
String[] splits = alias.split(this.entryNameSeparator, 2); |
|
if (splits.length == 2) { |
|
KeyStore keystore = keystores.get(splits[0]); |
|
if (keystore != null) { |
|
return new AbstractMap.SimpleEntry<>(splits[1], |
|
new AbstractMap.SimpleEntry<>(splits[0], keystore)); |
|
} |
|
} |
|
return null; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public String engineGetCertificateAlias(Certificate cert) { |
|
|
|
try { |
|
|
|
String alias = null; |
|
for (KeyStore keystore : keystores.values()) { |
|
if ((alias = keystore.getCertificateAlias(cert)) != null) { |
|
break; |
|
} |
|
} |
|
return alias; |
|
|
|
} catch (KeyStoreException e) { |
|
throw new IllegalStateException(e); |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void engineStore(OutputStream stream, char[] password) |
|
throws IOException, NoSuchAlgorithmException, CertificateException |
|
{ |
|
// Support storing to a stream only when a single keystore has been |
|
|
|
try { |
|
if (keystores.size() == 1) { |
|
keystores.values().iterator().next().store(stream, password); |
|
return; |
|
} |
|
} catch (KeyStoreException e) { |
|
throw new IllegalStateException(e); |
|
} |
|
|
|
throw new UnsupportedOperationException( |
|
"This keystore must be stored using a DomainLoadStoreParameter"); |
|
} |
|
|
|
@Override |
|
public void engineStore(KeyStore.LoadStoreParameter param) |
|
throws IOException, NoSuchAlgorithmException, CertificateException |
|
{ |
|
if (param instanceof DomainLoadStoreParameter) { |
|
DomainLoadStoreParameter domainParameter = |
|
(DomainLoadStoreParameter) param; |
|
List<KeyStoreBuilderComponents> builders = getBuilders( |
|
domainParameter.getConfiguration(), |
|
domainParameter.getProtectionParams()); |
|
|
|
for (KeyStoreBuilderComponents builder : builders) { |
|
|
|
try { |
|
|
|
KeyStore.ProtectionParameter pp = builder.protection; |
|
if (!(pp instanceof KeyStore.PasswordProtection)) { |
|
throw new KeyStoreException( |
|
new IllegalArgumentException("ProtectionParameter" + |
|
" must be a KeyStore.PasswordProtection")); |
|
} |
|
char[] password = |
|
((KeyStore.PasswordProtection) builder.protection) |
|
.getPassword(); |
|
|
|
|
|
KeyStore keystore = keystores.get(builder.name); |
|
|
|
try (FileOutputStream stream = |
|
new FileOutputStream(builder.file)) { |
|
|
|
keystore.store(stream, password); |
|
} |
|
} catch (KeyStoreException e) { |
|
throw new IOException(e); |
|
} |
|
} |
|
} else { |
|
throw new UnsupportedOperationException( |
|
"This keystore must be stored using a " + |
|
"DomainLoadStoreParameter"); |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void engineLoad(InputStream stream, char[] password) |
|
throws IOException, NoSuchAlgorithmException, CertificateException |
|
{ |
|
|
|
try { |
|
KeyStore keystore = null; |
|
|
|
try { |
|
keystore = KeyStore.getInstance("JKS"); |
|
keystore.load(stream, password); |
|
|
|
} catch (Exception e) { |
|
|
|
if (!"JKS".equalsIgnoreCase(DEFAULT_KEYSTORE_TYPE)) { |
|
keystore = KeyStore.getInstance(DEFAULT_KEYSTORE_TYPE); |
|
keystore.load(stream, password); |
|
} else { |
|
throw e; |
|
} |
|
} |
|
String keystoreName = DEFAULT_STREAM_PREFIX + streamCounter++; |
|
keystores.put(keystoreName, keystore); |
|
|
|
} catch (Exception e) { |
|
throw new UnsupportedOperationException( |
|
"This keystore must be loaded using a " + |
|
"DomainLoadStoreParameter"); |
|
} |
|
} |
|
|
|
@Override |
|
public void engineLoad(KeyStore.LoadStoreParameter param) |
|
throws IOException, NoSuchAlgorithmException, CertificateException |
|
{ |
|
if (param instanceof DomainLoadStoreParameter) { |
|
DomainLoadStoreParameter domainParameter = |
|
(DomainLoadStoreParameter) param; |
|
List<KeyStoreBuilderComponents> builders = getBuilders( |
|
domainParameter.getConfiguration(), |
|
domainParameter.getProtectionParams()); |
|
|
|
for (KeyStoreBuilderComponents builder : builders) { |
|
|
|
try { |
|
|
|
if (builder.file != null) { |
|
keystores.put(builder.name, |
|
KeyStore.Builder.newInstance(builder.type, |
|
builder.provider, builder.file, |
|
builder.protection) |
|
.getKeyStore()); |
|
} else { |
|
keystores.put(builder.name, |
|
KeyStore.Builder.newInstance(builder.type, |
|
builder.provider, builder.protection) |
|
.getKeyStore()); |
|
} |
|
} catch (KeyStoreException e) { |
|
throw new IOException(e); |
|
} |
|
} |
|
} else { |
|
throw new UnsupportedOperationException( |
|
"This keystore must be loaded using a " + |
|
"DomainLoadStoreParameter"); |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
*/ |
|
private List<KeyStoreBuilderComponents> getBuilders(URI configuration, |
|
Map<String, KeyStore.ProtectionParameter> passwords) |
|
throws IOException { |
|
|
|
PolicyParser parser = new PolicyParser(true); |
|
Collection<PolicyParser.DomainEntry> domains = null; |
|
List<KeyStoreBuilderComponents> builders = new ArrayList<>(); |
|
String uriDomain = configuration.getFragment(); |
|
|
|
try (InputStreamReader configurationReader = |
|
new InputStreamReader( |
|
PolicyUtil.getInputStream(configuration.toURL()), "UTF-8")) { |
|
parser.read(configurationReader); |
|
domains = parser.getDomainEntries(); |
|
|
|
} catch (MalformedURLException mue) { |
|
throw new IOException(mue); |
|
|
|
} catch (PolicyParser.ParsingException pe) { |
|
throw new IOException(pe); |
|
} |
|
|
|
for (PolicyParser.DomainEntry domain : domains) { |
|
Map<String, String> domainProperties = domain.getProperties(); |
|
|
|
if (uriDomain != null && |
|
(!uriDomain.equalsIgnoreCase(domain.getName()))) { |
|
continue; |
|
} |
|
|
|
if (domainProperties.containsKey(ENTRY_NAME_SEPARATOR)) { |
|
this.entryNameSeparator = |
|
domainProperties.get(ENTRY_NAME_SEPARATOR); |
|
|
|
char ch = 0; |
|
StringBuilder s = new StringBuilder(); |
|
for (int i = 0; i < this.entryNameSeparator.length(); i++) { |
|
ch = this.entryNameSeparator.charAt(i); |
|
if (REGEX_META.indexOf(ch) != -1) { |
|
s.append('\\'); |
|
} |
|
s.append(ch); |
|
} |
|
this.entryNameSeparatorRegEx = s.toString(); |
|
} |
|
|
|
Collection<PolicyParser.KeyStoreEntry> keystores = |
|
domain.getEntries(); |
|
for (PolicyParser.KeyStoreEntry keystore : keystores) { |
|
String keystoreName = keystore.getName(); |
|
Map<String, String> properties = |
|
new HashMap<>(domainProperties); |
|
properties.putAll(keystore.getProperties()); |
|
|
|
String keystoreType = DEFAULT_KEYSTORE_TYPE; |
|
if (properties.containsKey(KEYSTORE_TYPE)) { |
|
keystoreType = properties.get(KEYSTORE_TYPE); |
|
} |
|
|
|
Provider keystoreProvider = null; |
|
if (properties.containsKey(KEYSTORE_PROVIDER_NAME)) { |
|
String keystoreProviderName = |
|
properties.get(KEYSTORE_PROVIDER_NAME); |
|
keystoreProvider = |
|
Security.getProvider(keystoreProviderName); |
|
if (keystoreProvider == null) { |
|
throw new IOException("Error locating JCE provider: " + |
|
keystoreProviderName); |
|
} |
|
} |
|
|
|
File keystoreFile = null; |
|
if (properties.containsKey(KEYSTORE_URI)) { |
|
String uri = properties.get(KEYSTORE_URI); |
|
|
|
try { |
|
if (uri.startsWith("file://")) { |
|
keystoreFile = new File(new URI(uri)); |
|
} else { |
|
keystoreFile = new File(uri); |
|
} |
|
|
|
} catch (URISyntaxException | IllegalArgumentException e) { |
|
throw new IOException( |
|
"Error processing keystore property: " + |
|
"keystoreURI=\"" + uri + "\"", e); |
|
} |
|
} |
|
|
|
KeyStore.ProtectionParameter keystoreProtection = null; |
|
if (passwords.containsKey(keystoreName)) { |
|
keystoreProtection = passwords.get(keystoreName); |
|
|
|
} else if (properties.containsKey(KEYSTORE_PASSWORD_ENV)) { |
|
String env = properties.get(KEYSTORE_PASSWORD_ENV); |
|
String pwd = System.getenv(env); |
|
if (pwd != null) { |
|
keystoreProtection = |
|
new KeyStore.PasswordProtection(pwd.toCharArray()); |
|
} else { |
|
throw new IOException( |
|
"Error processing keystore property: " + |
|
"keystorePasswordEnv=\"" + env + "\""); |
|
} |
|
} else { |
|
keystoreProtection = new KeyStore.PasswordProtection(null); |
|
} |
|
|
|
builders.add(new KeyStoreBuilderComponents(keystoreName, |
|
keystoreType, keystoreProvider, keystoreFile, |
|
keystoreProtection)); |
|
} |
|
break; |
|
} |
|
if (builders.isEmpty()) { |
|
throw new IOException("Error locating domain configuration data " + |
|
"for: " + configuration); |
|
} |
|
|
|
return builders; |
|
} |
|
|
|
|
|
|
|
*/ |
|
class KeyStoreBuilderComponents { |
|
String name; |
|
String type; |
|
Provider provider; |
|
File file; |
|
KeyStore.ProtectionParameter protection; |
|
|
|
KeyStoreBuilderComponents(String name, String type, Provider provider, |
|
File file, KeyStore.ProtectionParameter protection) { |
|
this.name = name; |
|
this.type = type; |
|
this.provider = provider; |
|
this.file = file; |
|
this.protection = protection; |
|
} |
|
} |
|
} |