• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Bartender
Posts: 1166
17
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Bartender
Posts: 1166
17
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Bartender
Posts: 1166
17
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ).
 
reply
    Bookmark Topic Watch Topic
  • New Topic