Plumtree EDK (Enterprise Web Development Kit) 5.4.0

IPortletRequest.GetEncryptedSettingValue Method 

Gives the value for any portal preference.

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

Parameters

type
the type of setting (e.g., Admin, User, or Portlet)
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 that the CreateEncryptor method on the same CryptoServiceProvider should be used to encrypt the value in IPortletResponse.SetEncryptedSettingValue

Exceptions

Exception TypeCondition
NotGatewayedException if the request is not gatewayed
CryptoException if there is an error decrypting the setting value

See Also

IPortletRequest Interface | Plumtree.Remote.Portlet Namespace