本文整理汇总了C#中OctetString.GetRaw方法的典型用法代码示例。如果您正苦于以下问题:C# OctetString.GetRaw方法的具体用法?C# OctetString.GetRaw怎么用?C# OctetString.GetRaw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OctetString
的用法示例。
在下文中一共展示了OctetString.GetRaw方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MD5AuthenticationProvider
/// <summary>
/// Initializes a new instance of the <see cref="MD5AuthenticationProvider"/> class.
/// </summary>
/// <param name="phrase">The phrase.</param>
public MD5AuthenticationProvider(OctetString phrase)
{
if (phrase == null)
{
throw new ArgumentNullException("phrase");
}
_password = phrase.GetRaw();
}
示例2: SecurityParameters
/// <summary>
/// Initializes a new instance of the <see cref="SecurityParameters"/> class.
/// </summary>
/// <param name="parameters">The <see cref="OctetString"/> that contains parameters.</param>
public SecurityParameters(OctetString parameters)
{
if (parameters == null)
{
throw new ArgumentNullException("parameters");
}
Sequence data = (Sequence)DataFactory.CreateSnmpData(parameters.GetRaw());
EngineId = (OctetString)data[0];
EngineBoots = (Integer32)data[1];
EngineTime = (Integer32)data[2];
UserName = (OctetString)data[3];
AuthenticationParameters = (OctetString)data[4];
PrivacyParameters = (OctetString)data[5];
}
示例3: SecurityParameters
/// <summary>
/// Initializes a new instance of the <see cref="SecurityParameters"/> class.
/// </summary>
/// <param name="parameters">The <see cref="OctetString"/> that contains parameters.</param>
public SecurityParameters(OctetString parameters)
{
if (parameters == null)
{
throw new ArgumentNullException("parameters");
}
var container = (Sequence)DataFactory.CreateSnmpData(parameters.GetRaw());
EngineId = (OctetString)container[0];
EngineBoots = (Integer32)container[1];
EngineTime = (Integer32)container[2];
UserName = (OctetString)container[3];
AuthenticationParameters = (OctetString)container[4];
PrivacyParameters = (OctetString)container[5];
_length = container.GetLengthBytes();
}