-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathAcmeIdentifier.cs
More file actions
64 lines (57 loc) · 1.32 KB
/
AcmeIdentifier.cs
File metadata and controls
64 lines (57 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System;
using System.Collections.Generic;
using System.Text;
using Waher.Content;
using Waher.Content.Xml;
namespace Waher.Security.ACME
{
/// <summary>
/// Represents an ACME identifier.
/// </summary>
public class AcmeIdentifier : AcmeObject
{
private readonly string type = null;
private readonly string value = null;
/// <summary>
/// Represents an ACME identifier.
/// </summary>
/// <param name="Client">ACME Client.</param>
/// <param name="Type">Type of identifier.</param>
/// <param name="Value">Identifier value.</param>
public AcmeIdentifier(AcmeClient Client, string Type, string Value)
: base(Client)
{
this.type = Type;
this.value = Value;
}
internal AcmeIdentifier(AcmeClient Client, IEnumerable<KeyValuePair<string, object>> Obj)
: base(Client)
{
foreach (KeyValuePair<string, object> P in Obj)
{
switch (P.Key)
{
case "type":
this.type = P.Value as string;
break;
case "value":
this.value = P.Value as string;
break;
}
}
}
/// <summary>
/// Type of identifier.
/// </summary>
public string Type => this.type;
/// <summary>
/// Identifier value.
/// </summary>
public string Value => this.value;
/// <inheritdoc/>
public override string ToString()
{
return this.type + ":" + this.value;
}
}
}