Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
DistributionPoint.cs
1using System.Diagnostics.CodeAnalysis;
2
4{
8 public class DistributionPoint
9 {
10 private string url = string.Empty;
11 private Vector? reasons = null;
12 private Vector? crlIssuer = null;
13
20 public static bool TryCreate(Vector SecurityInfo, [NotNullWhen(true)] out DistributionPoint? Result)
21 {
22 Result = new DistributionPoint();
23
24 int i = 0;
25 int c = SecurityInfo.Length;
26
27 if (i < c && SecurityInfo[i] is Vector DistributionPointName)
28 {
29 i++;
30
31 if (!GeneralName.TryParse(DistributionPointName, out object? Name) ||
32 Name is not string Url)
33 {
34 return false;
35 }
36
37 Result.url = Url;
38 }
39
40 if (i < c && SecurityInfo[i] is Vector Reasons)
41 {
42 i++;
43 Result.reasons = Reasons;
44 }
45
46 if (i < c && SecurityInfo[i] is Vector CrlIssuer)
47 {
48 i++;
49 Result.crlIssuer = CrlIssuer;
50 }
51
52 if (i < c)
53 {
54 Result = null;
55 return false;
56 }
57 else
58 return true;
59 }
60
64 public string Url => this.url;
65 }
66}
static bool TryCreate(Vector SecurityInfo, [NotNullWhen(true)] out DistributionPoint? Result)
Tries to create a Distribution Point object instance from its ASN.1 decoded representation.
Abstract base class for general name properties.
Definition: GeneralName.cs:12
static bool TryParse(Vector ParsedVector, [NotNullWhen(true)] out object? Name)
Tries to parse a general name from an ASN.1 decoded vector.
Definition: GeneralName.cs:59