/** * Default constructor which uses an existing KeyStore instance for loading of credentials. Available keys are * calculated automatically. * * @param keyStore key store to use * @param passwords passwords used to access private keys * @param defaultKey default key */ public JKSKeyManager(KeyStore keyStore, Map<String, String> passwords, String defaultKey) { this.keyStore = keyStore; this.availableKeys = getAvailableKeys(keyStore); this.credentialResolver = new KeyStoreCredentialResolver(keyStore, passwords); this.defaultKey = defaultKey; }
/** * Default constructor which instantiates a new KeyStore used to load all credentials. Available keys are * calculated automatically. * * @param storeFile file pointing to the JKS keystore * @param storePass password to access the keystore, or null for no password * @param passwords passwords used to access private keys * @param defaultKey default key */ public JKSKeyManager(Resource storeFile, String storePass, Map<String, String> passwords, String defaultKey) { this.keyStore = initialize(storeFile, storePass, "JKS"); this.availableKeys = getAvailableKeys(keyStore); this.credentialResolver = new KeyStoreCredentialResolver(keyStore, passwords); this.defaultKey = defaultKey; }