70 lines
2.5 KiB
C#
70 lines
2.5 KiB
C#
|
// /**
|
|||
|
// * File: UsmSecurityParameters.cs
|
|||
|
// * Author: haraldwolff
|
|||
|
// *
|
|||
|
// * This file and it's content is copyrighted by the Author and / or copyright holder.
|
|||
|
// * Any use wihtout proper permission is illegal and may lead to legal actions.
|
|||
|
// *
|
|||
|
// *
|
|||
|
// **/
|
|||
|
using System;
|
|||
|
using ln.snmp.asn1;
|
|||
|
using System.Linq;
|
|||
|
namespace ln.snmp.types
|
|||
|
{
|
|||
|
public class UsmSecurityParameters : AbstractSequence
|
|||
|
{
|
|||
|
public OctetString msgAuthoritativeEngineID { get; set; }
|
|||
|
public Integer msgAuthoritativeEngineBoots { get; set; }
|
|||
|
public Integer msgAuthoritativeEngineTime { get; set; }
|
|||
|
|
|||
|
public OctetString msgUserName { get; set; }
|
|||
|
public OctetString msgAuthenticationParameters { get; set; }
|
|||
|
public OctetString msgPrivacyParameters { get; set; }
|
|||
|
|
|||
|
|
|||
|
public UsmSecurityParameters()
|
|||
|
:base(new Identifier(IdentifierClass.UNIVERSAL,true,0x10))
|
|||
|
{
|
|||
|
msgAuthoritativeEngineID = new OctetString();
|
|||
|
msgAuthoritativeEngineBoots = new Integer();
|
|||
|
msgAuthoritativeEngineTime = new Integer();
|
|||
|
|
|||
|
msgUserName = new OctetString();
|
|||
|
msgAuthenticationParameters = new OctetString();
|
|||
|
msgPrivacyParameters = new OctetString();
|
|||
|
}
|
|||
|
|
|||
|
public UsmSecurityParameters(ASN1Value asn)
|
|||
|
:base(asn.Identifier)
|
|||
|
{
|
|||
|
Items = asn.Items.Select((x) => (Variable)x).ToArray();
|
|||
|
}
|
|||
|
|
|||
|
public override Variable[] Items
|
|||
|
{
|
|||
|
get => new Variable[] {
|
|||
|
msgAuthoritativeEngineID,
|
|||
|
msgAuthoritativeEngineBoots,
|
|||
|
msgAuthoritativeEngineTime,
|
|||
|
msgUserName,
|
|||
|
msgAuthenticationParameters,
|
|||
|
msgPrivacyParameters
|
|||
|
};
|
|||
|
set
|
|||
|
{
|
|||
|
msgAuthoritativeEngineID = value[0] as OctetString;
|
|||
|
msgAuthoritativeEngineBoots = value[1] as Integer;
|
|||
|
msgAuthoritativeEngineTime = value[2] as Integer;
|
|||
|
msgUserName = value[3] as OctetString;
|
|||
|
msgAuthenticationParameters = value[4] as OctetString;
|
|||
|
msgPrivacyParameters = value[5] as OctetString;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public override void Add(Variable item) => throw new NotImplementedException();
|
|||
|
public override void Remove(Variable item) => throw new NotImplementedException();
|
|||
|
|
|||
|
}
|
|||
|
}
|