wood burning stoves 2.0*
The moose likes Security and the fly likes How to specify sterotype in pom.xml-jarsigner error: java.lang.RuntimeException:keystore load:Invali Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "How to specify sterotype in pom.xml-jarsigner error: java.lang.RuntimeException:keystore load:Invali" Watch "How to specify sterotype in pom.xml-jarsigner error: java.lang.RuntimeException:keystore load:Invali" New topic
Author

How to specify sterotype in pom.xml-jarsigner error: java.lang.RuntimeException:keystore load:Invali

Raghu Sha
Ranch Hand

Joined: Feb 02, 2013
Posts: 122
Hi,
I got the certifcate which is having sterortype as pkcs12.
I need to add this into pom.xml.
I had given alias,storepass correctly except sterortype.
Getting error as jarsigner error: java.lang.RuntimeException: keystore load: Invalid keystore format

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>sign</id>
<phase>install</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<archiveDirectory>target/encrypte.jar</archiveDirectory>
<excludes>
<exclude>**/S*.jar</exclude>
</excludes>
<includes>
<include>**/*.jar</include>
</includes>
<keystore>src/main/resources/Cert.pfx</keystore>
<alias>myalias</alias>
<storepass>*****</storepass>
</configuration>
</plugin>
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1035
    
  10

You have not explicitly specified the 'storetype' (not 'sterotype') as pkcs12 so the default store type is assumed (which as I would expect would seen not to be pkcs12). Read the Mavern documentation for the 'jarsigner:sign' plugin.
Raghu Sha
Ranch Hand

Joined: Feb 02, 2013
Posts: 122
Thanks,
I didnt used storetype.
Still i am getting jarsigner error: java.lang.RuntimeException: keystore load: Invalid keystore format.

Please let me know if i am missing anything.
Please modify the pom.xml
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1035
    
  10

Raghu Sha wrote:
I didnt used storetype.l


Exactly - that is why the exception was thrown !!! You need to specify the 'storetype' as pkcs12 !!! The documentation tells you exactly how to do that.
Raghu Sha
Ranch Hand

Joined: Feb 02, 2013
Posts: 122
Thanks..
It is working now after adding storetype.

How to specify signed jar location in pom.xml?
<signedjar>target/Signed.jar</signedjar>

After that only i can make sure jar is signed.

I am referring
http://www.baselogic.com/blog/development/maven/invalid-keystore-format-and-keytool-genkey-issues-during-jar-signing/
But signedjar tag not available in below link
http://maven.apache.org/plugins/maven-jarsigner-plugin/sign-mojo.html
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1035
    
  10

You have lost me. There is no 'signedjar' element in jarsigner:sign specification. For both signing and verifying the jar is specified using the 'archive' and 'achiveDirectory' elements (the first two in http://maven.apache.org/plugins/maven-jarsigner-plugin/sign-mojo.html ).
 
Don't get me started about those stupid light bulbs.
 
subject: How to specify sterotype in pom.xml-jarsigner error: java.lang.RuntimeException:keystore load:Invali
 
Similar Threads
Strange problem - works on maven glassfish but not on Tomcat
Sonar - Native Plugin
where do i add the reporting tag so that i get the maven test reports generated in surefire reports
Cannot find parent error while "mvn compile"
emma-maven-plugin - filter excludes