aboutsummaryrefslogtreecommitdiffstats
path: root/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/utlis/SecurityKeysUtil.java
diff options
context:
space:
mode:
authorgrabinsk <maciej.grabinski@nokia.com>2019-05-15 12:49:47 +0200
committergrabinsk <maciej.grabinski@nokia.com>2019-05-15 15:35:58 +0200
commit4d53427075cf4e5deaee88d59bc4b9a03d2fc225 (patch)
tree695b7e67c230b86c706ee57ac549d8447293ed95 /rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/utlis/SecurityKeysUtil.java
parent3f6de371dcd59126e2e7933d31f970391a1ad517 (diff)
Fix loading of ssl keys from external files for dmaap and AAI client4.0.0-ONAP1.1.6dublin
Change-Id: I18a68656ddfc8290e17fb483900c26baf3e25ba6 Issue-ID: DCAEGEN2-1503 Signed-off-by: grabinsk <maciej.grabinski@nokia.com>
Diffstat (limited to 'rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/utlis/SecurityKeysUtil.java')
-rw-r--r--rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/utlis/SecurityKeysUtil.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/utlis/SecurityKeysUtil.java b/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/utlis/SecurityKeysUtil.java
index 7ee06e9c..d487e19b 100644
--- a/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/utlis/SecurityKeysUtil.java
+++ b/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/utlis/SecurityKeysUtil.java
@@ -20,8 +20,6 @@
package org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.utlis;
-import io.vavr.control.Try;
-import java.nio.file.Path;
import java.nio.file.Paths;
import org.jetbrains.annotations.NotNull;
import org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.config.DmaapCustomConfig;
@@ -32,20 +30,17 @@ import org.onap.dcaegen2.services.sdk.security.ssl.SecurityKeys;
public final class SecurityKeysUtil {
- private SecurityKeysUtil(){
+ private SecurityKeysUtil() {
}
@NotNull
- public static SecurityKeys fromDmappCustomConfig(DmaapCustomConfig configuration){
+ public static SecurityKeys fromDmappCustomConfig(DmaapCustomConfig configuration) {
return ImmutableSecurityKeys.builder()
- .keyStore(ImmutableSecurityKeysStore.of(resource(configuration.keyStorePath()).get()))
- .keyStorePassword(Passwords.fromResource(configuration.keyStorePasswordPath()))
- .trustStore(ImmutableSecurityKeysStore.of(resource(configuration.trustStorePath()).get()))
- .trustStorePassword(Passwords.fromResource(configuration.trustStorePasswordPath()))
+ .keyStore(ImmutableSecurityKeysStore.of(Paths.get(configuration.keyStorePath())))
+ .keyStorePassword(Passwords.fromPath(Paths.get(configuration.keyStorePasswordPath())))
+ .trustStore(ImmutableSecurityKeysStore.of(Paths.get(configuration.trustStorePath())))
+ .trustStorePassword(Passwords.fromPath(Paths.get(configuration.trustStorePasswordPath())))
.build();
}
-
- private static Try<Path> resource(String resource) {
- return Try.of(() -> Paths.get(Passwords.class.getResource(resource).toURI()));
- }}
+} \ No newline at end of file