com.beasys.commerce.ebusiness.security
Class EncryptorImpl

java.lang.Object
  extended by com.beasys.commerce.foundation.SessionImpl
      extended by com.beasys.commerce.ebusiness.security.EncryptorImpl
All Implemented Interfaces
Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean

public class EncryptorImpl
extends SessionImpl

The EncryptorImpl is the implementation used by the Encryptor service.
Encryption does not require that the server be in a consistent state. This ensures that data gets encrypted and stored and in turn orders go through by default.

See Also
Encryptor, EncryptorHome, Serialized Form

Field Summary
 
Fields inherited from class com.beasys.commerce.foundation.SessionImpl
_ctx, _environmentNamingContext, _environmentPropertyCache, _isDirty
 
Constructor Summary
EncryptorImpl()
           
 
Method Summary
 void ejbActivate()
          ejbActivate method.
 void ejbCreate()
          ejbCreate method.
 void ejbPassivate()
          ejbPassivate method.
 void ejbPostCreate()
          ejbPostCreate method.
 void ejbRemove()
          ejbRemove method.
 String encrypt(String dataToEncrypt)
          Takes string of data to encrypt and returns a string of encrypted data.
 void setSessionContext(javax.ejb.SessionContext ctx)
          setSessionContext method.
 
Methods inherited from class com.beasys.commerce.foundation.SessionImpl
clearRelationalBinding, clearRelationalBinding, clearRelationalBinding, clearRelationalBinding, doRelationalBinding, doRelationalBinding, doRelationalBindingOnElement, doRelationalBindingOnElement, doRelationalBindingOnElement, doRelationalBindingOnSingleton, doRelationalBindingOnSingleton, doRelationalBindingOnSingleton, doRelationalBindingWithMapKey, doRelationalBindingWithMapKey, doRelationalBindingWithMapKey, enumerateRelationalBinding, enumerateRelationalBinding, getEnvironmentNamingContext, getEnvironmentProperty, getEnvironmentProperty, getEnvironmentPropertyCache, getPersistenceHelperPlugin, getSessionContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncryptorImpl

public EncryptorImpl()
Method Detail

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException
Description copied from class: SessionImpl
ejbCreate method.

Overrides:
ejbCreate in class SessionImpl
Throws
javax.ejb.CreateException

ejbPostCreate

public void ejbPostCreate()
                   throws javax.ejb.CreateException
Description copied from class: SessionImpl
ejbPostCreate method.

Overrides:
ejbPostCreate in class SessionImpl
Throws
javax.ejb.CreateException

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException
Description copied from class: SessionImpl
ejbActivate method.

Specified by:
ejbActivate in interface javax.ejb.SessionBean
Overrides:
ejbActivate in class SessionImpl
Throws
javax.ejb.EJBException

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException
Description copied from class: SessionImpl
ejbPassivate method.

Specified by:
ejbPassivate in interface javax.ejb.SessionBean
Overrides:
ejbPassivate in class SessionImpl
Throws
javax.ejb.EJBException

ejbRemove

public void ejbRemove()
               throws javax.ejb.EJBException
Description copied from class: SessionImpl
ejbRemove method.

Specified by:
ejbRemove in interface javax.ejb.SessionBean
Overrides:
ejbRemove in class SessionImpl
Throws
javax.ejb.EJBException

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
                       throws javax.ejb.EJBException
Description copied from class: SessionImpl
setSessionContext method.

Specified by:
setSessionContext in interface javax.ejb.SessionBean
Overrides:
setSessionContext in class SessionImpl
Throws
javax.ejb.EJBException

encrypt

public String encrypt(String dataToEncrypt)
               throws InconsistentStateException
Takes string of data to encrypt and returns a string of encrypted data.
The encryption process involves getting an instance of the KeyFactory and retrieving the public key from it. The encrypted data, which is really a sequence of bytes is then base-64 encoded to convert it to a byte sequence that can be easily persisted.

Parameters
dataToEncrypt - The plain text that needs to be encrypted.
Returns
s string of encrypted data.
Throws
InconsistentStateException - if the server is not initialized with decryption password.


Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.