issrg.saml
Class SAMLSecurity

java.lang.Object
  extended by issrg.saml.SAMLSecurity

public class SAMLSecurity
extends java.lang.Object

Author:
Linying Su

Field Summary
static int DSA
           
static int ENCRYPTEDKEY
           
static int JKS
           
static int KEY
           
static int KEYSTORE
           
static int KEYSTORE_TYPE
           
static int PASSWORD
           
static int PKC
           
static int PKCS12
          This class implements a security that uses a PKCS#12 file, a proxy certificate file or a pair of key files (PKC and private key) to authenticate the user and obtain the signing and signature verification keys.
static java.lang.String[] prompts
           
static int PROXY_CERTIFICATE
           
static int RSA
           
 
Constructor Summary
SAMLSecurity()
           
 
Method Summary
 java.lang.String callbackInfo(int type)
          this method is used to callback a security information, which was used to login the user.
 java.security.cert.Certificate[][] getPKCs()
          this method is used to get the PKC chains, which authenticates the user.
 java.security.Key[] getPrivateKeys()
          this method is used to set 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(int method)
          this method is used to authenticate the user interactively with a proxy certificate a keystore a key pair (PKC and private key)
 void LoginByProg(int type, java.lang.String pkc, java.lang.String key)
          this method is used to authenticate the user programatically with a key pair.
 void LoginByProg(int type, java.lang.String pkc, java.lang.String key, java.lang.String passwd)
          this method is used to authenticate the user programatically with a key pair.
 void LoginByProg(java.lang.String proxy)
          this method is used to authenticate the user programatically with a proxy certificate.
 void LoginByProg(java.lang.String keystore, java.lang.String passwd, int type)
          this method is used to authenticate the user programatically with a keystore file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PKCS12

public static int PKCS12
This class implements a security that uses a PKCS#12 file, a proxy certificate file or a pair of key files (PKC and private key) to authenticate the user and obtain the signing and signature verification keys.


JKS

public static int JKS

RSA

public static int RSA

DSA

public static int DSA

ENCRYPTEDKEY

public static int ENCRYPTEDKEY

PASSWORD

public static int PASSWORD

PROXY_CERTIFICATE

public static int PROXY_CERTIFICATE

KEYSTORE

public static int KEYSTORE

PKC

public static int PKC

KEY

public static int KEY

KEYSTORE_TYPE

public static int KEYSTORE_TYPE

prompts

public static java.lang.String[] prompts
Constructor Detail

SAMLSecurity

public SAMLSecurity()
             throws SecurityException
Throws:
SecurityException
Method Detail

login

public void login(int method)
           throws java.lang.Exception
this method is used to authenticate the user interactively with a proxy certificate a keystore a key pair (PKC and private key)

Parameters:
method - is used to indicate the authentication method, specified by KEY, ENCRYPTEDKEY,PROXY_CERTIFICATE and KEYSTORE.
Throws:
java.lang.Exception

LoginByProg

public void LoginByProg(java.lang.String keystore,
                        java.lang.String passwd,
                        int type)
                 throws SecurityException
this method is used to authenticate the user programatically with a keystore file.

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

LoginByProg

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

Parameters:
pkc - is the file name of the public key certificate.
key - is the file name of the private key. the key should not be encrypted
type - is the type of the key.
Throws:
SecurityException

LoginByProg

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

Parameters:
pkc - is the file name of the public key certificate.
key - is the file name of the private key. the key must be encrypted
type - is the type of the key.
passwd - is the password of the key.
Throws:
SecurityException

LoginByProg

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

Parameters:
proxy - is the file name of the 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 PKC chains, which authenticates the user.


getPrivateKeys

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


callbackInfo

public java.lang.String callbackInfo(int type)
this method is used to callback a security information, which was used to login the user.

Parameters:
type - indicates which information is wantted.
Returns:
a String, which represents the information.

getUserDN

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