|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsecurity.SignUtils
public class SignUtils
Constructor Summary | |
---|---|
SignUtils()
|
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
|
static void |
packSignAndVerify()
|
static void |
packSignAndVerify(java.lang.String className,
java.lang.String keystoreName,
java.lang.String storepass,
java.lang.String alias)
|
static void |
resignJar(java.io.File file)
This will unsign a jar file (even if it does not need to) and then will sign the jar file. |
static void |
resignJars()
|
static java.lang.String |
runJarSigner(java.lang.String[] args,
java.io.File workingDir)
This runs the jar signer with the arguments in the args array |
static void |
signGui()
This gui assumes the webstart bean has correct information and that the keystore has a correct certificate. |
static boolean |
signJar()
|
static void |
signJar(java.io.File targetJarFile,
WebStartBean wsb)
|
static java.lang.String |
signJar(java.lang.String keystoreName,
java.lang.String storepass,
java.io.File jarFileName,
java.lang.String alias)
Assume that the keystore password and the certificate password are the same. |
static void |
signOneJarGui()
|
static void |
testPackSignAndVerify()
|
static void |
testVerifyJarVerbose()
|
static void |
unsignJar(java.io.File inputJar)
Makes a tmp directory where the jar is, unjars it. |
static void |
verifyJar(java.io.File jarFileName)
This method causes the callers thread of execution to terminate after the run! |
static void |
verifyJarVerbose(java.io.File jarFile)
Run the jarsigner with the verification and verbose commands. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SignUtils()
Method Detail |
---|
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public static void resignJars() throws java.security.NoSuchAlgorithmException, java.io.IOException, java.security.cert.CertificateException, java.security.KeyStoreException
java.security.NoSuchAlgorithmException
java.io.IOException
java.security.cert.CertificateException
java.security.KeyStoreException
public static void testVerifyJarVerbose()
public static void verifyJarVerbose(java.io.File jarFile)
jarFile
- a file that should be a jar file.public static java.lang.String runJarSigner(java.lang.String[] args, java.io.File workingDir)
args
- arguments passed to the jar signerworkingDir
- place where jar signer starts working
public static void signGui()
public static void signOneJarGui()
public static void testPackSignAndVerify()
public static void packSignAndVerify()
public static void packSignAndVerify(java.lang.String className, java.lang.String keystoreName, java.lang.String storepass, java.lang.String alias)
public static java.lang.String signJar(java.lang.String keystoreName, java.lang.String storepass, java.io.File jarFileName, java.lang.String alias)
keytool -keypasswd -alias duke -keypass dukekeypasswd -new newpass
To change the password of the keystore, use:
jarsigner -keypass newDukeKeyPassword
keystoreName
- fully qualified path to keystore.storepass
- certificate and store passwordjarFileName
- thing to be signedalias
- certificate name
public static void verifyJar(java.io.File jarFileName)
jarFileName
- verifys the jar files after signingpublic static void signJar(java.io.File targetJarFile, WebStartBean wsb)
public static boolean signJar() throws java.security.NoSuchAlgorithmException, java.io.IOException, java.security.cert.CertificateException, java.security.KeyStoreException
java.security.NoSuchAlgorithmException
java.io.IOException
java.security.cert.CertificateException
java.security.KeyStoreException
public static void resignJar(java.io.File file) throws java.security.NoSuchAlgorithmException, java.io.IOException, java.security.cert.CertificateException, java.security.KeyStoreException
file
- the file to be resigned.
java.security.NoSuchAlgorithmException
- if you can't find the RSA algorithm
java.io.IOException
- if you can't restore the WebStartBean
java.security.cert.CertificateException
- if you can restore the keystore bean
java.security.KeyStoreException
- if you don't have access to the keystorepublic static void unsignJar(java.io.File inputJar)
inputJar
- to be unsigned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |