issrg.security
Class MultiFileTypeSecurity

java.lang.Object
  extended by issrg.security.DefaultVerifier
      extended by issrg.security.DefaultSecurity
          extended by issrg.security.MultiFileTypeSecurity
All Implemented Interfaces:
SessionOriented, Signer, Verifier, javax.security.auth.spi.LoginModule

public class MultiFileTypeSecurity
extends DefaultSecurity


Field Summary
 
Fields inherited from class issrg.security.DefaultSecurity
ch, DEFAULT_FILE, DEFAULT_FILE_STRING, DIGEST_ALGORITHM, digestAlgorithm, DSA_ALGORITHMS, KEY_ALGORITHMS, LAST_FILE_STRING, MD2_WITH_RSA_ALGORITHM, MD4_WITH_RSA_ALGORITHM, MD5_WITH_RSA_ALGORITHM, options, PASSWORD_SHARES_INTEGER, PASSWORD_SHARES_STRING, PASSWORD_STORED, PASSWORDS, PROMPT_STRING, RSA_ALGORITHMS, SHA1_WITH_DSA_ALGORITHM, SHA1_WITH_RSA_ALGORITHM, sharedState, subj, TITLE_STRING
 
Constructor Summary
MultiFileTypeSecurity()
          Creates a new instance of MultiFileTypeSecurity
 
Method Summary
protected  FilenameCallback getFilenameCallback(java.lang.String filename)
          This method returns a FilenameCallback that prompts for implementation-specific type of files.
 java.security.cert.Certificate[][] getPKCs()
          this method is used to get the PKCs, which authenticates the user.
 java.security.Key[] getPrivateKeys()
          this method is used to get the private Keys, which authenticates the user.
 java.security.cert.Certificate[] getTrustedCertificates()
          this method is used to get the trusted certificates.
 java.lang.String getUserDN()
          this method returns the user DN
 void login(java.lang.String proxy)
          this method is used to authenticate the user with his proxy certificate.
 void login(java.lang.String keystore, char[] password)
          This method logs in using a single password.
 void login(java.lang.String keystore, int type, char[] passwd)
          this method is used to authenticate the user with a keystore.
 void login(java.lang.String pkc, java.lang.String key, int type)
          this method is used to authenticate the user with his key pair.
 void login(java.lang.String pkc, java.lang.String key, int type, java.lang.String password)
          this method is used to authenticate the user with his key pair.
 void loginWithKeystore(java.lang.String keystore, char[] passwd, java.lang.String type)
          this method login the user with a keystore
 
Methods inherited from class issrg.security.DefaultSecurity
abort, commit, getDigestAlgorithm, getPrivateKey, getSignature, getSigningAlgorithmID, getVerificationCertificate, initialize, isLoggedIn, login, login, logout, setDigestAlgorithm, setPrivateKey, setSignature, sign
 
Methods inherited from class issrg.security.DefaultVerifier
getPKCRepository, getRootCAs, getVerificationCertificates, setPKCRepository, setRootCA, setRootCA, setRootCAs, setRootCAs, verify, verifyByRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiFileTypeSecurity

public MultiFileTypeSecurity()
                      throws SecurityException
Creates a new instance of MultiFileTypeSecurity

Throws:
SecurityException
Method Detail

login

public void login(java.lang.String keystore,
                  int type,
                  char[] passwd)
           throws SecurityException
this method is used to authenticate the user with a keystore.

Parameters:
keystore - is the file name of the keystore.
type - is the type of the keystore (P12 or JKS).
passwd - is the password of the keystore.
Throws:
SecurityException

login

public void login(java.lang.String keystore,
                  char[] password)
           throws SecurityException
Description copied from class: DefaultSecurity
This method logs in using a single password.

Specified by:
login in class DefaultSecurity
Parameters:
keystore - - the file containing the encrypted Private Key of the user
password - - the password to be used to decrypt the key
Throws:
SecurityException

loginWithKeystore

public void loginWithKeystore(java.lang.String keystore,
                              char[] passwd,
                              java.lang.String type)
                       throws SecurityException
this method login the user with a keystore

Parameters:
keystore - is the file name of the keystore.
passwd - is the password of the keystore.
type - is the type of the srore "PKCS12" or "JKS"
Throws:
SecurityException

login

public void login(java.lang.String pkc,
                  java.lang.String key,
                  int type,
                  java.lang.String password)
           throws SecurityException
this method is used to authenticate the user with his key pair.

Parameters:
pkc - is the file name of a public key certificate.
key - is the file name of a private key (OpenSSL PEM Key).
password - is the password to protect the private key. i.e. the key must be encrypted. if password is null, then an unencrypted key is assumed.
Throws:
SecurityException

login

public void login(java.lang.String pkc,
                  java.lang.String key,
                  int type)
           throws SecurityException
this method is used to authenticate the user with his key pair.

Parameters:
pkc - is the file name of a public key certificate.
key - is the file name of a private key. The key should not be encrypted.
type - is the key type (i.e. DSA or RSA).
Throws:
SecurityException

login

public void login(java.lang.String proxy)
           throws SecurityException
this method is used to authenticate the user with his proxy certificate.

Parameters:
proxy - is the file name of a proxy certificate.
Throws:
SecurityException

getTrustedCertificates

public java.security.cert.Certificate[] getTrustedCertificates()
this method is used to get the trusted certificates.


getPKCs

public java.security.cert.Certificate[][] getPKCs()
this method is used to get the PKCs, which authenticates the user.


getPrivateKeys

public java.security.Key[] getPrivateKeys()
this method is used to get the private Keys, which authenticates the user.


getUserDN

public java.lang.String getUserDN()
this method returns the user DN


getFilenameCallback

protected FilenameCallback getFilenameCallback(java.lang.String filename)
This method returns a FilenameCallback that prompts for implementation-specific type of files.

Specified by:
getFilenameCallback in class DefaultSecurity
Parameters:
filename - - the default file to be prompted by CallbackHandler
Returns:
FilenameCallback to be used to prompt for files