Uses the cryptographer supplied by the client to encrypt and set a new value for a setting.
To retrieve an encrypted setting, the Portlet must use IPortletRequest.GetEncryptedSettingValue()
with the same cryptographer. Note: UserInfo settings cannot be set by a Portlet. For example:
IPortletResponse portletResponse = ...;
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().CreateEncryptor(secretKey, initVector);
portletResponse.SetEncryptedSettingValue(SettingType.Admin, "password", "secretpassword",cryptoTransform);
Note that the CreateDecryptor method on the same CryptoServiceProvider should be used to decrypt the value in IPortletRequest.GetEncryptedSettingValueException Type | Condition |
---|---|
NotGatewayedException | if the request is not gatewayed |
ArgumentException | if the user tries to set a UserInfo setting |
CryptoException | if there is an error encrypting the setting value |
IPortletResponse Interface | Plumtree.Remote.Portlet Namespace