Skip to content

Commit

Permalink
Finalizing BlendedEncryptor main line end encryptor script.
Browse files Browse the repository at this point in the history
  • Loading branch information
atooni committed Mar 16, 2019
1 parent 09c1727 commit 190fdd1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
7 changes: 5 additions & 2 deletions blended.launcher/src/runner/resources/bin/encryptor.sh
Expand Up @@ -26,10 +26,13 @@ export BLENDED_HOME=$(blended_home $BLENDED_HOME)
cd $BLENDED_HOME cd $BLENDED_HOME


# column-separated # 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\ exec ${JAVA_HOME}/bin/java\
-cp\ -cp\
"${ENC_CP}"\ "${ENC_CP}"\
blended.security.crypto.Encryptor\ blended.security.crypto.BlendedEncryptor\
"$@" "$@"
Expand Up @@ -17,17 +17,16 @@ object BlendedEncryptor {


if (cmdLine.help || args.isEmpty) { if (cmdLine.help || args.isEmpty) {
cp.usage() cp.usage()
throw new NoArgsProvidedException } else {
} val cs : ContainerCryptoSupport = BlendedCryptoSupport.initCryptoSupport(cmdLine.secret)


val cs : ContainerCryptoSupport = BlendedCryptoSupport.initCryptoSupport(cmdLine.secret) cmdLine.plain.foreach { p =>

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

0 comments on commit 190fdd1

Please sign in to comment.