Compiere 3.1

org.compiere.install
Class KeyStoreMgt

java.lang.Object
  extended by org.compiere.install.KeyStoreMgt

public class KeyStoreMgt
extends Object

Class to manage SSL KeyStore

Version:
$Id: KeyStoreMgt.java,v 1.3 2006/07/30 00:57:42 jjanke Exp $
Author:
Jorg Janke

Field Summary
static String CERTIFICATE_ALIAS
          Certificate Alias
static String KEYSTORE_DIRECTORY
          Directory below COMPIERE_HOME
static String KEYSTORE_NAME
          Name of KeyStore
 
Constructor Summary
KeyStoreMgt(String fileName, char[] password)
          Constructor.
 
Method Summary
static String escapeCommas(String in)
          Escape Commas
static void genkey(String alias, char[] password, String fileName, String dname)
          Generate Key
 Certificate getCertificate(String alias)
          Get Certificate
static String getDname(JFrame parent)
          Get Distinguised Name
 KeyStore getKeyStore()
          Get KeyStore
static String getKeystoreFileName(String baseDir)
          Get Keystore File Name
static void keytool(String cmd)
          Submit Command to Key Tool
static void main(String[] args)
          Test
static void selfcert(String alias, char[] password, String fileName, String dname)
          Generate Key
 String verify(JFrame parent)
          Verify/Create Key Store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEYSTORE_DIRECTORY

public static String KEYSTORE_DIRECTORY
Directory below COMPIERE_HOME


KEYSTORE_NAME

public static String KEYSTORE_NAME
Name of KeyStore


CERTIFICATE_ALIAS

public static String CERTIFICATE_ALIAS
Certificate Alias

Constructor Detail

KeyStoreMgt

public KeyStoreMgt(String fileName,
                   char[] password)
Constructor.

Parameters:
fileName - key store file name
password - - same password for key store and certificate
Method Detail

verify

public String verify(JFrame parent)
Verify/Create Key Store

Parameters:
parent - frame
Returns:
null or error message

getKeyStore

public KeyStore getKeyStore()
                     throws Exception
Get KeyStore

Returns:
KeyStore or null
Throws:
Exception

getCertificate

public Certificate getCertificate(String alias)
                           throws Exception
Get Certificate

Parameters:
alias - alias
Returns:
certificate or null
Throws:
Exception

getDname

public static String getDname(JFrame parent)
Get Distinguised Name

Parameters:
parent - interactive dialog
Returns:
dname or null

escapeCommas

public static String escapeCommas(String in)
Escape Commas

Parameters:
in - input string
Returns:
excaped string

genkey

public static void genkey(String alias,
                          char[] password,
                          String fileName,
                          String dname)
Generate Key

Parameters:
alias - compiere
password - password
fileName - key store file name (may have spaces)
dname - distinguished name

selfcert

public static void selfcert(String alias,
                            char[] password,
                            String fileName,
                            String dname)
Generate Key

Parameters:
alias - compiere
password - password
fileName - key store file name (may have spaces)
dname - distinguished name

keytool

public static void keytool(String cmd)
Submit Command to Key Tool

Parameters:
cmd - command

getKeystoreFileName

public static String getKeystoreFileName(String baseDir)
Get Keystore File Name

Parameters:
baseDir - COMPIERE_HOME
Returns:
file name

main

public static void main(String[] args)
Test

Parameters:
args - ignored

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.