Skip to content
Permalink
Browse files

Finalizing BlendedEncryptor main line end encryptor script.

  • Loading branch information...
atooni committed Mar 16, 2019
1 parent 09c1727 commit 190fdd14ea6d7b498b43bae4e11197c9e220f136
@@ -26,10 +26,13 @@ export BLENDED_HOME=$(blended_home $BLENDED_HOME)
cd $BLENDED_HOME

# column-separated
ENC_CP="${BLENDED_HOME}/lib/*"
ENC_CP="${BLENDED_HOME}/lib/blended.security.crypto_@scala.binary.version@-@blended.security.crypto.version@.jar:\
${BLENDED_HOME}/lib/scala-library-@scala.library.version@.jar:\
${BLENDED_HOME}/lib/de.tototec.cmdoption-@cmdoption.version@.jar\
"

exec ${JAVA_HOME}/bin/java\
-cp\
"${ENC_CP}"\
blended.security.crypto.Encryptor\
blended.security.crypto.BlendedEncryptor\
"$@"
@@ -17,17 +17,16 @@ object BlendedEncryptor {

if (cmdLine.help || args.isEmpty) {
cp.usage()
throw new NoArgsProvidedException
}

val cs : ContainerCryptoSupport = BlendedCryptoSupport.initCryptoSupport(cmdLine.secret)

cmdLine.plain.foreach { p =>
cs.encrypt(p) match {
case Failure(t) =>
System.err.println(s"Could not encrypt [$p] : [${t.getMessage()}]")
case Success(e) =>
System.out.println(s"Encrypted value for [$p] : [$e]")
} else {
val cs : ContainerCryptoSupport = BlendedCryptoSupport.initCryptoSupport(cmdLine.secret)

cmdLine.plain.foreach { p =>
cs.encrypt(p) match {
case Failure(t) =>
System.err.println(s"Could not encrypt [$p] : [${t.getMessage()}]")
case Success(e) =>
System.out.println(s"Encrypted value for [$p] : [$e]")
}
}
}
}
@@ -52,6 +52,7 @@ object BlendedLauncher extends ProjectFactory {
"blended.launcher.version" -> version.value,
"blended.updater.config.version" -> version.value,
"blended.util.logging.version" -> version.value,
"blended.security.crypto.version" -> version.value,
"cmdoption.version" -> Dependencies.cmdOption.revision,
"org.osgi.core.version" -> Dependencies.orgOsgi.revision,
"scala.binary.version" -> scalaBinaryVersion.value,

0 comments on commit 190fdd1

Please sign in to comment.
You can’t perform that action at this time.