Re: Digital Signature for MIDlet?

Joe Bowbeer <[email protected]>
Newsgroups gmane.comp.java.sun.kvm
Message-ID <[email protected]>
FooShyn,

I sent an update to kvm-interest last year when JadTool was fixed:

"JadTool for cert chains fixed in WTK2.5 Beta"
http://archives.java.sun.com/cgi-bin/wa?A2=ind0607&L=kvm-interest&F=&S=&P=1177

(So you can use the JadTool in the WTK 2.5.1 release.)

With the updated JadTool, the following command *will* include all
certificates chained to the alias:

   java -jar JadTool.jar -addcert alias mykey -keystore keystore
      -inputjad in.jad -outputjad out.jad

However, I generally invoke this from Ant using a target like the following:

  <target name="sign" depends="jar">
      <input message="Enter ${keyalias} password:" addproperty="keypass"/>
       <java jar="${jadtool.jar}" fork="true" failonerror="true">
          <arg value="-addjarsig"/>
          <arg value="-jarfile"/>
          <arg file="${dist.dir}/${project.jar}"/>
          <arg value="-keystore"/>
          <arg file="${keystore}"/>
          <arg value="-keypass"/>
          <arg value="${keypass}"/>
          <arg value="-alias"/>
          <arg value="${keyalias}"/>
          <arg value="-inputjad"/>
          <arg file="${dist.dir}/${project.jad}"/>
          <arg value="-outputjad"/>
          <arg file="${dist.dir}/${project.jad}"/>
      </java>
       <java jar="${jadtool.jar}" fork="true" failonerror="true">
          <arg value="-addcert"/>
          <arg value="-keystore"/>
          <arg file="${keystore}"/>
          <arg value="-alias"/>
          <arg value="${keyalias}"/>
          <arg value="-inputjad"/>
          <arg file="${dist.dir}/${project.jad}"/>
          <arg value="-outputjad"/>
          <arg file="${dist.dir}/${project.jad}"/>
      </java>
       <java jar="${jadtool.jar}" fork="true" failonerror="true">
          <arg line="-showcert -all"/>
          <arg value="-inputjad"/>
          <arg file="${dist.dir}/${project.jad}"/>
      </java>
  </target>

Note also that your cert entries in the JAD file are constants, so
alternatively you could just paste them into the JAD file each time.

--
Joe Bowbeer


On 8/8/07, foo shyn wrote:
> As how most of you guys predicted, we're facing tonnes of problem trying
> to sign our MIDlet.
>
> The latest issue we had now is that the certificate info on the JAD is
> invalid as described here
> http://archives.java.sun.com/cgi-bin/wa?A2=ind0508&L=kvm-interest&F=&S=&P=9858
>
> When we try to download the application to install, the untrusted
> message is gone but we failed to install the application with an error
> message
> 'Installation Security Error. Unable to install.'.
>
> I'm trying to look for workaround beside the GUI mentioned. Does anyone
> come across any method to have the JAD file signed correctly?
>
> Thanx
> FooShyn
>

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff KVM-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.