diff options
Diffstat (limited to 'certServiceClient/src/main/java/org/onap')
-rw-r--r-- | certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/ConvertedArtifactsCreator.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/ConvertedArtifactsCreator.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/ConvertedArtifactsCreator.java index 0ecee793..4826732c 100644 --- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/ConvertedArtifactsCreator.java +++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/ConvertedArtifactsCreator.java @@ -61,8 +61,8 @@ public class ConvertedArtifactsCreator implements ArtifactsCreator { private void createKeystore(List<String> data, PrivateKey privateKey) throws PemConversionException, CertFileWriterException { Password password = passwordGenerator.generate(PASSWORD_LENGTH); - String keystoreArtifactName = String.format("%s.%s", KEYSTORE, fileExtension); - String keystorePass = String.format("%s.%s", KEYSTORE, PASS_EXT); + String keystoreArtifactName = getFilenameWithExtension(KEYSTORE, fileExtension); + String keystorePass = getFilenameWithExtension(KEYSTORE, PASS_EXT); LOGGER.debug("Attempt to create keystore files and saving data. File names: {}, {}", keystoreArtifactName, keystorePass); @@ -73,8 +73,8 @@ public class ConvertedArtifactsCreator implements ArtifactsCreator { private void createTruststore(List<String> data) throws PemConversionException, CertFileWriterException { Password password = passwordGenerator.generate(PASSWORD_LENGTH); - String truststoreArtifactName = String.format("%s.%s", TRUSTSTORE, fileExtension); - String truststorePass = String.format("%s.%s", TRUSTSTORE, PASS_EXT); + String truststoreArtifactName = getFilenameWithExtension(TRUSTSTORE, fileExtension); + String truststorePass = getFilenameWithExtension(TRUSTSTORE, PASS_EXT); LOGGER.debug("Attempt to create truststore files and saving data. File names: {}, {}", truststoreArtifactName, truststorePass); @@ -85,4 +85,8 @@ public class ConvertedArtifactsCreator implements ArtifactsCreator { private byte[] getPasswordAsBytes(Password password) { return password.getCurrentPassword().getBytes(); } + + private String getFilenameWithExtension(String filename, String extension) { + return String.format("%s.%s", filename, extension); + } } |