ellandrd
asked on
never expire signed jar
how can i create a self-certify jar/applet so that it never expires
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
so far i have this:
<target name="package" depends="build" description="--> create distribution">
<jar destfile="LDAPConnector.ja r" basedir="${project.build}" update="false">
<manifest>
<attribute name="Built-By" value="Sean Delaney"/>
<attribute name="Main-Class" value="${project.main.clas s}"/>
<attribute name="Specification-Title" value="${ant.project.name} "/>
</manifest>
</jar>
<antcall target="sign-jar">
</antcall>
</target>
<target name="sign-jar">
<!-- check if a keystore file is required -->
<condition property="keystore.missing ">
<not>
<available file="${basedir}/etc/SeanD elaneyStor e">
</available>
</not>
</condition>
<antcall target="generate-keystore" >
</antcall>
<signjar jar="LDAPConnector.jar" keystore="${basedir}/etc/S eanDelaney Store" alias="SeanDelaneySign" signedjar="sLDAPConnector. jar" storepass="xxx" keypass="xxx" verbose="true">
</signjar>
</target>
<target name="generate-keystore" if="keystore.missing">
<echo>***** Generating a new keystore file. *****</echo>
<genkey alias="SeanDelaneySign" storepass="xxx" verbose="true" keystore="${basedir}/etc/S eanDelaney Store" keypass="xxx" dname="CN=Sean Delaney, OU=Sean Delaney, O=User, C=Pegasus International">
</genkey>
</target>
not too sure where ot add these extra bits.
<target name="package" depends="build" description="--> create distribution">
<jar destfile="LDAPConnector.ja
<manifest>
<attribute name="Built-By" value="Sean Delaney"/>
<attribute name="Main-Class" value="${project.main.clas
<attribute name="Specification-Title"
</manifest>
</jar>
<antcall target="sign-jar">
</antcall>
</target>
<target name="sign-jar">
<!-- check if a keystore file is required -->
<condition property="keystore.missing
<not>
<available file="${basedir}/etc/SeanD
</available>
</not>
</condition>
<antcall target="generate-keystore"
</antcall>
<signjar jar="LDAPConnector.jar" keystore="${basedir}/etc/S
</signjar>
</target>
<target name="generate-keystore" if="keystore.missing">
<echo>***** Generating a new keystore file. *****</echo>
<genkey alias="SeanDelaneySign" storepass="xxx" verbose="true" keystore="${basedir}/etc/S
</genkey>
</target>
not too sure where ot add these extra bits.
Make that
<genkey validity="18250" alias="SeanDelaneySign" storepass="xxx" verbose="true" keystore="${basedir}/etc/S eanDelaney Store" keypass="xxx" dname="CN=Sean Delaney, OU=Sean Delaney, O=User, C=Pegasus International">
</genkey>
<genkey validity="18250" alias="SeanDelaneySign" storepass="xxx" verbose="true" keystore="${basedir}/etc/S
</genkey>
ASKER
Mmm i though you said use self cert?
so i had:
<selfcert validity="18250" alias="SeanDelaneySign" storepass="xxx" verbose="true" keystore="${basedir}/etc/S eanDelaney Store" keypass="xxx" dname="CN=Sean Delaney, OU=Sean Delaney, O=User, C=Pegasus International">
</selfcert>
does it matter?
so i had:
<selfcert validity="18250" alias="SeanDelaneySign" storepass="xxx" verbose="true" keystore="${basedir}/etc/S
</selfcert>
does it matter?
ASKER
when i package my application is still get a message saying this
Warning: The signer certificate will expire within six months.
im using netbeans...
Warning: The signer certificate will expire within six months.
im using netbeans...
>>Mmm i though you said use self cert?
Well, since you have genkey and it has a 'validity' attribute, you may as well use it
>>im using netbeans...
Make sure it's not ignoring build.xml and that genkey is running
Well, since you have genkey and it has a 'validity' attribute, you may as well use it
>>im using netbeans...
Make sure it's not ignoring build.xml and that genkey is running
ASKER
ive created my own ANT file to create the package so it isnt using the default build.xml.
im assume it is running OK, it creates my signed JAR's etc fine, but it keeps saying expires in 6 mnths..
when i select to trust it on my machines and check to see what the validity is set at, they all all set to toexpire in Aug 27 2006.... so i need to get this never expire thingy working...
i have tired both <selfcert ..></selfcert> and <keygen ...></keygen> and both say the same...
im assume it is running OK, it creates my signed JAR's etc fine, but it keeps saying expires in 6 mnths..
when i select to trust it on my machines and check to see what the validity is set at, they all all set to toexpire in Aug 27 2006.... so i need to get this never expire thingy working...
i have tired both <selfcert ..></selfcert> and <keygen ...></keygen> and both say the same...
Are you sure the target 'generate-keystore' is running?
ASKER
i will print out the output from my package...and show you
ASKER
build:
package:
Building jar: C:\Pegasus\JavaApplication 14\LDAPCon nector.jar
sign-jar:
generate-keystore:
Signing JAR: C:\Pegasus\JavaApplication 14\LDAPCon nector.jar
updating: META-INF/MANIFEST.MF
adding: META-INF/SEANDELA.SF
adding: META-INF/SEANDELA.DSA
adding: org/
signing: org/LDAPConnector.class
Warning: The signer certificate will expire within six months.
BUILD SUCCESSFUL (total time: 1 second)
package:
Building jar: C:\Pegasus\JavaApplication
sign-jar:
generate-keystore:
Signing JAR: C:\Pegasus\JavaApplication
updating: META-INF/MANIFEST.MF
adding: META-INF/SEANDELA.SF
adding: META-INF/SEANDELA.DSA
adding: org/
signing: org/LDAPConnector.class
Warning: The signer certificate will expire within six months.
BUILD SUCCESSFUL (total time: 1 second)
Can you run ant with
-v
and see what it says
-v
and see what it says
ASKER
OK
i only know how to run ANt from creating a mybuild.xml file and setting my targets etc.
i have never used it by command linea nd the version of ANT i have came by default with netbeans 5.
i only know how to run ANt from creating a mybuild.xml file and setting my targets etc.
i have never used it by command linea nd the version of ANT i have came by default with netbeans 5.
You need to find out how to use Ant fully within Netbeans then or ingore Netbeans and run it from the command line
ASKER
OK... i will close this question accepting your first comment and try to get ANT working...
if i still have problems, i'll just open another question and maybe you can see what im doing wrong...
thanks BTW
if i still have problems, i'll just open another question and maybe you can see what im doing wrong...
thanks BTW
:-)
ASKER
im not too sure how how edit my build.xml file and add these extra params in... maybe some help please?