AquaLogic Interaction Development Kit (IDK) 6.0.0 |

# IPortletRequest.GetEncryptedSettingValue Method

Gives the value for any encrypted portal preference associated with this portlet.

string GetEncryptedSettingValue(
SettingType type,
string name,
ICryptoTransform crypto
);

#### Parameters

type
  The type of setting (Admin, Community, CommunityPortlet, Portlet, Session, User or UserInfo).
name
  The name of the setting.
crypto
  The cryptographer that can decode the setting value.

#### Return Value

The decoded setting value.

#### Remarks

Uses the cryptographer supplied by the client to unencrypt the setting value from the portal. For example: ``

IPortletRequest portletRequest = ...;

byte[] secretKey = new byte[8] { 1,2,3,4,5,6,7,8 };

byte[] initVector new byte[8] { 1,2,3,4,5,6,7,8 };

ICryptoTransform cryptoTransform = new DESCryptoServiceProvider().CreateDecryptor(secretKey, initVector);

String decryptedValue = portletRequest.GetEncryptedSettingValue(SettingType.Admin, "password", cipher);

Note: The `CreateEncryptor` method on the same `CryptoServiceProvider` should be used to encrypt the value in IPortletResponse.SetEncryptedSettingValue

#### Exceptions

Exception Type | Condition
--- | ---
NotGatewayedException | The request is not gatewayed.
CryptoException | If there is an error decrypting the setting value.

#### See Also

IPortletRequest Interface | Plumtree.Remote.Portlet Namespace