|
@@ -230,6 +230,7 @@ public class JavaKeyStoreProvider extends CredentialProvider {
|
|
|
|
|
|
CredentialEntry innerSetCredential(String alias, char[] material)
|
|
CredentialEntry innerSetCredential(String alias, char[] material)
|
|
throws IOException {
|
|
throws IOException {
|
|
|
|
+ writeLock.lock();
|
|
try {
|
|
try {
|
|
keyStore.setKeyEntry(alias, new SecretKeySpec(
|
|
keyStore.setKeyEntry(alias, new SecretKeySpec(
|
|
new String(material).getBytes("UTF-8"), "AES"),
|
|
new String(material).getBytes("UTF-8"), "AES"),
|
|
@@ -237,6 +238,8 @@ public class JavaKeyStoreProvider extends CredentialProvider {
|
|
} catch (KeyStoreException e) {
|
|
} catch (KeyStoreException e) {
|
|
throw new IOException("Can't store credential " + alias + " in " + this,
|
|
throw new IOException("Can't store credential " + alias + " in " + this,
|
|
e);
|
|
e);
|
|
|
|
+ } finally {
|
|
|
|
+ writeLock.unlock();
|
|
}
|
|
}
|
|
changed = true;
|
|
changed = true;
|
|
return new CredentialEntry(alias, material);
|
|
return new CredentialEntry(alias, material);
|