2using System.Diagnostics.CodeAnalysis;
3using System.Formats.Asn1;
22 if (SecurityInfo.Length != 2)
25 object? Last = SecurityInfo.LastElementNested;
27 if (Last is Vector Context)
28 return TryParse(Context, out this.name);
29 else if (Last is
byte[] BinName)
34 else if (Last is Array A && A.Length == 0)
36 this.name =
string.Empty;
51 public object?
Name => this.name;
59 public static bool TryParse(Vector ParsedVector, [NotNullWhen(
true)] out
object?
Name)
61 object? First = ParsedVector.FirstElement;
66 while (First is Vector v && v.Length == 1)
69 First = ParsedVector.FirstElement;
72 if (First is
byte[] GeneralName2)
74 else if (First is Vector v &&
76 v.FirstElement is
byte[] GeneralName3)
112 if (
Name is
byte[] BinIpAddress)
113 Name =
new IPAddress(BinIpAddress);
114 else if (
Name is
null)
Static class for parsing and decoding security objects encoded using Abstract Syntax Notation 1 (ASN....
static bool TryDecodeDerAs(UniversalTagNumber TagNumber, byte[] Data, out object? Value)
Decodes a DER-encoded object.
Abstract base class for general name properties.
static bool TryParse(Vector ParsedVector, [NotNullWhen(true)] out object? Name)
Tries to parse a general name from an ASN.1 decoded vector.
override bool Configure(Vector SecurityInfo)
If the object can be configured by the security information provided.
override bool IsConfigured
If the object has been configured.
Abstract base class for security objects.