Mark Southern > Jar-Signer-0.1 > Jar::Signer

Download:
Jar-Signer-0.1.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.1   Source  

NAME ^

Jar::Signer - Ease the process of creating a signed Jar file.

SYNOPSIS ^

# using FindBin is just a suggestion.

use FindBin qw( $RealBin );

use Jar::Signer;

my $signer = Jar::Signer->new;

# location of the keystore, created if needed.

$signer->keystore("$RealBin/MyKeyStore");

# dname properties of the certificate.

$signer->dname("CN=Mark Southern, O=My Corporation, L=My State, C=USA");

# name for .fingerprint and ..cert files, created if needed.

$signer->alias("$RealBin/MyCert");

# the Jar file that we want to sign.

$signer->jar(shift);

# if signed_jar is undefined then the default is basename.signed.jar where basename is the basename of the Jar file.

$signer->signed_jar(shift);

# create the signed Jar.

$signer->process;

DESCRIPTION ^

This module, and the script that uses it make it a lot simpler to generate signed Jar files for use in Java applets etc. It steps through all the needed jar, jarsigner and keytool command lines.

METHODS ^

jar

Sets/returns the name of the jar file to sign

signed_jar

Sets/returns the name of the signed Jar file to create. if this is undefined then the default is basename.signed.jar where basename is the basename of the Jar file.

keystore

Sets/returns the name of the key store to use.

alias

Sets/returns the base name for the .cert and .fingerprint files to use

process

The method that scripts everything together. You do not need to call any of the methods below as 'process' does this for you.

First the existance of the Jar file and the Keystore, certificate and fingerprint files are checked for with the latter three being created as needed. Then the policy file is checked for and added to the Jar. The jar is then signed.

add_policy_file

Adds the policy file to the Jar. Normally you do not need to call this. It is scripted by the 'process' method.

generate_signed_jar

Generates the signed Jar file. Normally you do not need to call this. It is scripted by the 'process' method.

generate_fingerprint

Generates a .fingerprint file. Normally you do not need to call this. It is scripted by the 'process' method.

generate_cert

Generates a .cert file. Normally you do not need to call this. It is scripted by the 'process' method. generate_keystore

SEE ALSO ^

http://java.sun.com/security/signExample12/

BUGS ^

Please report them!

TODO ^

You are still required to type in a password where required. It would be nice if this were set up as a property too.

The jarsigner.pl script could do with a lot of beefing up.

AUTHOR ^

Mark Southern (msouthern@exsar.com)

COPYRIGHT ^

Copyright (c) 2003, ExSAR Corporation. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the terms of the Perl Artistic License (see http://www.perl.com/perl/misc/Artistic.html)

syntax highlighting: