SOMA.security.infrastructure
Class ProfileManager

java.lang.Object
  extended bySOMA.security.infrastructure.ProfileManager
All Implemented Interfaces:
InfrastructureConst
Direct Known Subclasses:
ProfileManagerBox

public class ProfileManager
extends java.lang.Object
implements InfrastructureConst

This class is at a more higher level than the Entrust Java Toolkit. It will give the basic functionality for managing one's profile.

Version:
Author:
Luca Ghetti

Field Summary
protected  int cont
           
static int CREATE_PROFILE
           
protected  java.lang.String extension
           
protected  java.lang.String pkcs7FileName
           
(package private)  Infrastructure pki
           
(package private)  EntrustProfile profile
           
static int RECOVER_PROFILE
           
static java.lang.String SearchExpression
           
 
Constructor Summary
ProfileManager()
          To create the profile as a bean.
ProfileManager(Infrastructure pki)
          To create a new profile manager you need an EntrustInfrastructure object.
 
Method Summary
 void createProfile(java.lang.String refnum, java.lang.String authcode, java.lang.String password, java.lang.String filename)
          This method is used to create a new profile from scratch.
 X509Certificate[] decryptAndVerifyData(java.io.InputStream in, java.io.OutputStream out)
          Decrypts and verify data.
 void decryptData(java.io.InputStream in, java.io.OutputStream out)
          This method is used for encrypt message
 void encryptData(java.io.InputStream in, java.io.OutputStream out, X509Certificate certs)
          This method is used for encrypt message
protected  java.lang.String getCurrentFileName()
           
 java.lang.String getDistinguishName()
          Return the the Distinguish Name
 Infrastructure getEntrustInfrastructure()
          Gets the pki
 ETKCertificateVerifier getETKCertificateVerifier()
           
 EntrustProfile getProfile()
          Return current EntrustProfile value
 void logoffProfile()
          This method is used for logoff the profile.
 void logonProfile(java.lang.String filename, java.lang.String password)
          Logs on an existing profile stored in a file.
 void logonProfile(java.lang.String filename, java.lang.String password, boolean onLineLogon)
           
 void recoverProfile(java.lang.String refnum, java.lang.String authcode, java.lang.String password, java.lang.String filename)
          This method is used to recover a profile.
 void setEntrustInfrastructure(Infrastructure pki)
          Sets the pki
 void setProfile(EntrustProfile profile)
           
 void signAndEncryptData(java.io.InputStream in, java.io.OutputStream out, X509Certificate[] certs)
           
 byte[] signedData(byte[] inData)
          This method is used for signed message
 void signedData(java.io.InputStream inData, java.io.OutputStream outData)
          This method is used for signed message
 java.lang.String toString()
           
 void update(ProfileManager profile)
           
 boolean verifySignedData(byte[] in, X509Certificate cert)
           
 X509Certificate[] verifySignedData(java.io.InputStream in, java.io.OutputStream out, X509Certificate cert)
          This method is used for verify signed message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pkcs7FileName

protected java.lang.String pkcs7FileName

extension

protected java.lang.String extension

cont

protected int cont

pki

Infrastructure pki

profile

EntrustProfile profile

RECOVER_PROFILE

public static final int RECOVER_PROFILE
See Also:
Constant Field Values

CREATE_PROFILE

public static final int CREATE_PROFILE
See Also:
Constant Field Values

SearchExpression

public static final java.lang.String SearchExpression
See Also:
Constant Field Values
Constructor Detail

ProfileManager

public ProfileManager()
To create the profile as a bean.


ProfileManager

public ProfileManager(Infrastructure pki)
To create a new profile manager you need an EntrustInfrastructure object.

Parameters:
pki - is the pki the managed profile belongs to.
Method Detail

setProfile

public void setProfile(EntrustProfile profile)

setEntrustInfrastructure

public void setEntrustInfrastructure(Infrastructure pki)
Sets the pki


getEntrustInfrastructure

public Infrastructure getEntrustInfrastructure()
Gets the pki


getProfile

public EntrustProfile getProfile()
Return current EntrustProfile value


createProfile

public void createProfile(java.lang.String refnum,
                          java.lang.String authcode,
                          java.lang.String password,
                          java.lang.String filename)
                   throws java.io.FileNotFoundException,
                          com.entrust.security.exceptions.EntrustBaseException,
                          ControlPasswordException
This method is used to create a new profile from scratch. One must provide the two secrets needed by the entrust PKI.

Parameters:
refnum - is the reference number,
authcode - is the authentication code,
password - is the profile password,
filename - the file where the profile is being stored.
Throws:
java.io.FileNotFoundException
com.entrust.security.exceptions.EntrustBaseException
ControlPasswordException

recoverProfile

public void recoverProfile(java.lang.String refnum,
                           java.lang.String authcode,
                           java.lang.String password,
                           java.lang.String filename)
                    throws java.io.FileNotFoundException,
                           com.entrust.security.exceptions.EntrustBaseException,
                           ControlPasswordException
This method is used to recover a profile. One must provide the two secrets needed by the entrust PKI.

Parameters:
refnum - is the reference number,
authcode - is the authentication code,
password - is the profile password,
filename - the file where the profile is being stored.
Throws:
java.io.FileNotFoundException
com.entrust.security.exceptions.EntrustBaseException
ControlPasswordException

logonProfile

public void logonProfile(java.lang.String filename,
                         java.lang.String password)
                  throws java.io.FileNotFoundException,
                         com.entrust.security.exceptions.EntrustBaseException
Logs on an existing profile stored in a file.

Parameters:
filename - the file name,
password - the password.
Throws:
java.io.FileNotFoundException
com.entrust.security.exceptions.EntrustBaseException

logonProfile

public void logonProfile(java.lang.String filename,
                         java.lang.String password,
                         boolean onLineLogon)
                  throws java.io.FileNotFoundException,
                         com.entrust.security.exceptions.EntrustBaseException
Throws:
java.io.FileNotFoundException
com.entrust.security.exceptions.EntrustBaseException

logoffProfile

public void logoffProfile()
This method is used for logoff the profile.


signedData

public byte[] signedData(byte[] inData)
                  throws java.security.NoSuchAlgorithmException,
                         iaik.asn1.CodingException,
                         com.entrust.security.exceptions.EntrustBaseException,
                         iaik.pkcs.PKCSException,
                         java.io.IOException
This method is used for signed message

Returns:
the signed data.
Throws:
java.security.NoSuchAlgorithmException
iaik.asn1.CodingException
com.entrust.security.exceptions.EntrustBaseException
iaik.pkcs.PKCSException
java.io.IOException

signedData

public void signedData(java.io.InputStream inData,
                       java.io.OutputStream outData)
                throws java.security.NoSuchAlgorithmException,
                       iaik.asn1.CodingException,
                       com.entrust.security.exceptions.EntrustBaseException,
                       iaik.pkcs.PKCSException,
                       java.io.IOException
This method is used for signed message

Returns:
the signed data.
Throws:
java.security.NoSuchAlgorithmException
iaik.asn1.CodingException
com.entrust.security.exceptions.EntrustBaseException
iaik.pkcs.PKCSException
java.io.IOException

verifySignedData

public boolean verifySignedData(byte[] in,
                                X509Certificate cert)
                         throws java.security.NoSuchAlgorithmException,
                                iaik.asn1.CodingException,
                                com.entrust.security.exceptions.EntrustBaseException,
                                java.security.SignatureException,
                                iaik.pkcs.PKCSException,
                                java.io.IOException
Throws:
java.security.NoSuchAlgorithmException
iaik.asn1.CodingException
com.entrust.security.exceptions.EntrustBaseException
java.security.SignatureException
iaik.pkcs.PKCSException
java.io.IOException

verifySignedData

public X509Certificate[] verifySignedData(java.io.InputStream in,
                                          java.io.OutputStream out,
                                          X509Certificate cert)
                                   throws java.security.NoSuchAlgorithmException,
                                          iaik.asn1.CodingException,
                                          com.entrust.security.exceptions.EntrustBaseException,
                                          java.security.SignatureException,
                                          iaik.pkcs.PKCSException,
                                          java.io.IOException
This method is used for verify signed message

Returns:
the data.
Throws:
java.security.NoSuchAlgorithmException
iaik.asn1.CodingException
com.entrust.security.exceptions.EntrustBaseException
java.security.SignatureException
iaik.pkcs.PKCSException
java.io.IOException

encryptData

public void encryptData(java.io.InputStream in,
                        java.io.OutputStream out,
                        X509Certificate certs)
                 throws java.security.NoSuchAlgorithmException,
                        iaik.pkcs.PKCSException,
                        java.io.IOException
This method is used for encrypt message

Returns:
the encrypt data,
Throws:
java.security.NoSuchAlgorithmException
iaik.pkcs.PKCSException
java.io.IOException

decryptData

public void decryptData(java.io.InputStream in,
                        java.io.OutputStream out)
                 throws java.security.NoSuchAlgorithmException,
                        iaik.pkcs.PKCSException,
                        java.security.InvalidKeyException,
                        iaik.pkcs.PKCSException,
                        java.io.IOException
This method is used for encrypt message

Returns:
the decrypt data,
Throws:
java.security.NoSuchAlgorithmException
iaik.pkcs.PKCSException
java.security.InvalidKeyException
java.io.IOException

signAndEncryptData

public void signAndEncryptData(java.io.InputStream in,
                               java.io.OutputStream out,
                               X509Certificate[] certs)
                        throws java.security.NoSuchAlgorithmException,
                               iaik.pkcs.PKCSException,
                               java.io.IOException,
                               iaik.asn1.CodingException,
                               com.entrust.security.exceptions.EntrustBaseException
Throws:
java.security.NoSuchAlgorithmException
iaik.pkcs.PKCSException
java.io.IOException
iaik.asn1.CodingException
com.entrust.security.exceptions.EntrustBaseException

decryptAndVerifyData

public X509Certificate[] decryptAndVerifyData(java.io.InputStream in,
                                              java.io.OutputStream out)
                                       throws java.security.NoSuchAlgorithmException,
                                              iaik.pkcs.PKCSException,
                                              java.io.IOException,
                                              java.security.InvalidKeyException
Decrypts and verify data.

Parameters:
in - the input stream containing the DER encoded encrypted data
out - the output stream where to put the encoded data
Returns:
the signing certificates
Throws:
java.security.NoSuchAlgorithmException
iaik.pkcs.PKCSException
java.io.IOException
java.security.InvalidKeyException

getDistinguishName

public java.lang.String getDistinguishName()
                                    throws InfrastructureException
Return the the Distinguish Name

Throws:
InfrastructureException

getETKCertificateVerifier

public ETKCertificateVerifier getETKCertificateVerifier()
                                                 throws InfrastructureException
Throws:
InfrastructureException

toString

public java.lang.String toString()

update

public void update(ProfileManager profile)

getCurrentFileName

protected java.lang.String getCurrentFileName()


Copyright © 2004 Luca Foschini