本文整理汇总了C#中DotNetNuke.Security.PortalSecurity.Decrypt方法的典型用法代码示例。如果您正苦于以下问题:C# PortalSecurity.Decrypt方法的具体用法?C# PortalSecurity.Decrypt怎么用?C# PortalSecurity.Decrypt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Security.PortalSecurity
的用法示例。
在下文中一共展示了PortalSecurity.Decrypt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DecryptParameter
public static string DecryptParameter( string Value )
{
PortalSettings _portalSettings = PortalController.GetCurrentPortalSettings();
string strKey = _portalSettings.GUID.ToString(); // restrict the key to 6 characters to conserve space
PortalSecurity objSecurity = new PortalSecurity();
return objSecurity.Decrypt( strKey, Value );
}
示例2: DecryptParameter
public static string DecryptParameter(string value, string encryptionKey)
{
var objSecurity = new PortalSecurity();
//[DNN-8257] - Can't do URLEncode/URLDecode as it introduces issues on decryption (with / = %2f), so we use a modifed Base64
value = value.Replace("_", "/");
value = value.Replace("-", "+");
value = value.Replace("%3d", "=");
return objSecurity.Decrypt(encryptionKey, value);
}
示例3: DeserializeMessage
private EventMessage DeserializeMessage( string filePath, string subscriberId )
{
EventMessage message = new EventMessage();
StreamReader oStreamReader = File.OpenText( filePath );
string messageString = oStreamReader.ReadToEnd();
if( messageString.IndexOf( "EventMessage" ) < 0 )
{
PortalSecurity oPortalSecurity = new PortalSecurity();
messageString = oPortalSecurity.Decrypt( EventQueueConfiguration.GetConfig().EventQueueSubscribers[subscriberId].PrivateKey, messageString );
}
message.Deserialize( messageString );
oStreamReader.Close();
//remove the persisted message from the queue if it has expired
if( message.ExpirationDate < DateTime.Now )
{
File.Delete( filePath );
}
return message;
}
示例4: PersonalizeSystemMessage
/// <Summary>Does the replacement of tags on a givem message.</Summary>
/// <Param name="MessageValue">The message to be formatted.</Param>
/// <Param name="Prefix">The prefix to look for supported tags.</Param>
/// <Param name="objObject">
/// An object used to look for replacement values.
/// </Param>
/// <Param name="objType">
/// Object type for the object used to look for replacement values.
/// </Param>
/// <Returns>The message with the found tags replaced.</Returns>
private static string PersonalizeSystemMessage( string messageValue, string prefix, object objObject, Type objType )
{
string strPropertyValue = "";
ArrayList objProperties = CBO.GetPropertyInfo(objType);
for (int intProperty = 0; intProperty < objProperties.Count; intProperty++)
{
string strPropertyName = ((PropertyInfo)objProperties[intProperty]).Name;
if (Strings.InStr(1, messageValue, "[" + prefix + strPropertyName + "]", CompareMethod.Text) != 0)
{
PropertyInfo propInfo = (PropertyInfo)objProperties[intProperty];
object propValue = propInfo.GetValue(objObject, null);
if (propValue != null)
{
strPropertyValue = propValue.ToString();
}
// special case for encrypted passwords
if ((prefix + strPropertyName == "Membership:Password") && Convert.ToString(Globals.HostSettings["EncryptionKey"]) != "")
{
PortalSecurity objSecurity = new PortalSecurity();
strPropertyValue = objSecurity.Decrypt(Globals.HostSettings["EncryptionKey"].ToString(), strPropertyValue);
}
messageValue = Strings.Replace(messageValue, "[" + prefix + strPropertyName + "]", strPropertyValue, 1, -1, CompareMethod.Text);
}
}
return messageValue;
}