Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-4185

Command-line hashing of JSON objects provided interactively returns an exception

    Details

      Description

      The cli.sh secureHash command works when hashing a JSON object inline, but not when the JSON object is provided at the prompt.
      So, this works:

      ./cli.sh secureHash --algorithm SHA-1 -j {\"password\":\"myPassw0rd\"}
      

      This does not work:

      $ ./cli.sh secureHash --algorithm SHA-1 -j 
      Executing ./cli.sh...
      Starting shell in /Users/lana/openidm
      Using boot properties at /Users/lana/openidm/conf/boot/boot.properties
      Enter the Json value
      
      > Press ctrl-D to finish input
      Start data input:
      {"password":"myPassw0rd"}
      ^D
      Activating cryptography service of type: JCEKS provider:  location: security/keystore.jceks
      Available cryptography key: openidm-sym-default
      Available cryptography key: openidm-localhost
      CryptoService is initialized with 2 keys.
      Exception in thread "main" org.forgerock.json.JsonValueException: /: Expecting a java.lang.String
      	at org.forgerock.json.JsonValue.expect(JsonValue.java:1123)
      	at org.forgerock.json.JsonValue.asString(JsonValue.java:931)
      	at org.forgerock.openidm.crypto.impl.CryptoServiceImpl.hash(CryptoServiceImpl.java:293)
      	at org.forgerock.openidm.shell.impl.LocalCommandScope.secureHash(LocalCommandScope.java:305)
      	at org.forgerock.openidm.shell.impl.LocalCommandScope.secureHash(LocalCommandScope.java:285)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)
      	at org.forgerock.openidm.shell.impl.CommandProxy.execute(CommandProxy.java:61)
      	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
      	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
      	at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
      	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
      	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
      	at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
      	at org.apache.felix.gogo.runtime.CommandProcessorImpl.eval(CommandProcessorImpl.java:280)
      	at org.forgerock.openidm.shell.impl.Main.main(Main.java:65)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                travis.haagen Travis Haagen [X] (Inactive)
                Reporter:
                Lana Lana Frost
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: