# com.beasys.commerce.ebusiness.security
DecryptorImpl Class

public class DecryptorImpl
extends `SessionImpl`

The `DecryptorImpl` is the implementation used by the `Decryptor` service.
It uses RSA standard private key encryption for the implementation. The server should be in a consistent state before decryption services can be provided. If decryption services are requested of the `Decryptor` before the server is appropriately initialized, it throws an `InconsistentStateException`.

Related Topics

``DecryptorHome``
``DecryptorImpl``

Hierarchy
  `Object`
  `SessionImpl`
  `DecryptorImpl`

All Implemented Interfaces
  `EnterpriseBean`, `Serializable`, `SessionBean`

## Field Summary

Fields from com.beasys.commerce.foundation`.`SessionImpl``
``_ctx`, `_environmentNamingContext`, `_environmentPropertyCache`, `_isDirty``

## Constructor Summary

DecryptorImpl()

## Method Summary

`public `String`` | `decrypt`(`String` dataToDecrypt) Takes a byte string of data to decrypt and returns a string of plain text.
`public void` | `ejbActivate`() ejbActivate method.
`public void` | `ejbCreate`() ejbCreate method.
`public void` | `ejbPassivate`() ejbPassivate method.
`public void` | `ejbPostCreate`() ejbPostCreate method.
`public void` | `ejbRemove`() ejbRemove method.
`public void` | `setSessionContext`(`SessionContext` ctx) setSessionContext method.

Methods from `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 from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods from interface `javax.ejb.`SessionBean``
`ejbActivate, ejbPassivate, ejbRemove, setSessionContext`

## Constructor Detail

### DecryptorImpl

    public DecryptorImpl()

## Method Detail

### decrypt(String) Method

    public String decrypt(String dataToDecrypt)
         throws InconsistentStateException

Takes a byte string of data to decrypt and returns a string of plain text.
The decryption process involves getting an instance of the KeyFactory and retrieving the private key from it. The encrypted data, which is really a base-64 encoded string, is then decoded to convert it to the byte sequence that the `Encryptor` returned as a result of the encryption process. This byte sequence is then passed on the decryption routine to get back the original text. A `SystemException` is thrown if the string being decrypted was encrypted using a public key that is not part of the key pair that the private key is a part of.

#### Parameters

dataToDecrypt
  The encrypted string that needs to be decrypted.

#### Returns

s string of decrypted data.

#### Exceptions

``InconsistentStateException``
  if the server is not initialized with decryption password.

### ejbActivate() Method

    public void ejbActivate()
         throws EJBException

Description copied from `SessionImpl.ejbActivate()`
ejbActivate method.

Overrides
  `SessionImpl.ejbActivate()`

#### Exceptions

``EJBException``

### ejbCreate() Method

    public void ejbCreate()
         throws CreateException

Description copied from `SessionImpl.ejbCreate()`
ejbCreate method.

Overrides
  `SessionImpl.ejbCreate()`

#### Exceptions

``CreateException``

### ejbPassivate() Method

    public void ejbPassivate()
         throws EJBException

Description copied from `SessionImpl.ejbPassivate()`
ejbPassivate method.

Overrides
  `SessionImpl.ejbPassivate()`

#### Exceptions

``EJBException``

### ejbPostCreate() Method

    public void ejbPostCreate()
         throws CreateException

Description copied from `SessionImpl.ejbPostCreate()`
ejbPostCreate method.

Overrides
  `SessionImpl.ejbPostCreate()`

#### Exceptions

``CreateException``

### ejbRemove() Method

    public void ejbRemove()
         throws EJBException

Description copied from `SessionImpl.ejbRemove()`
ejbRemove method.

Overrides
  `SessionImpl.ejbRemove()`

#### Exceptions

``EJBException``

### setSessionContext(SessionContext) Method

    public void setSessionContext(SessionContext ctx)
         throws EJBException

Description copied from `SessionImpl.setSessionContext(SessionContext)`
setSessionContext method.

Overrides
  `SessionImpl.setSessionContext(SessionContext)`

#### Exceptions

``EJBException``