FileDocCategorySizeDatePackage
ARG_jkspwdfile.javaAPI DocGlassfish v2 API3741Fri May 04 22:35:06 BST 2007com.sun.enterprise.tools.upgrade.common.arguments

ARG_jkspwdfile

public class ARG_jkspwdfile extends CertificateArgumentHandler
author
Hans Hrasna

Fields Summary
private String
jksPwdFile
Constructors Summary
public ARG_jkspwdfile(ParsedArgument pa)
Creates a new instance of ARG_jkspwdfile

        super(pa);
        if (parameters.isEmpty()) {
            helpUsage(sm.getString("enterprise.tools.upgrade.cli.argument_missing", "--jkspwdfile/-j"));
            System.exit(1);
        }
        jksPwdFile = (String)parameters.firstElement();
        processCertificatePasswords(jksPwdFile);       
    
Methods Summary
protected voidsetCertificatePassword(java.lang.String password)

       if(password == null) {
            _logger.severe(sm.getString("enterprise.tools.upgrade.cli.password_error",jksPwdFile));
            System.exit(1);
        }
        commonInfo.setJksKeystorePassword(password);
        String jksPath="";
        if(commonInfo.isUpgradeNSStoJKS()){
            if(!interactiveMap.containsKey("target"))
                return;
            jksPath=commonInfo.getTargetJKSKeyStorePath();
        } else {
            if(!interactiveMap.containsKey("source"))
                return;
            jksPath=commonInfo.getSourceJKSKeyStorePath();
        }
        boolean validpwd = PasswordVerifier.verifyKeystorePassword(jksPath,password);
        if(!validpwd) {
            commonInfo.recover();
            _logger.severe(sm.getString("enterprise.tools.upgrade.cli.Invalid_jks_keypair_password"));
            System.exit(1);
        }
        interactiveMap.put(ArgsParser.JKSPWD + "-" + commonInfo.getCurrentDomain(), jksPwdFile);