Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
LegalIdentityState.cs
1using System;
2using System.Text;
6
8{
12 [CollectionName("LegalIdentityStates")]
13 [TypeName(TypeNameSerialization.None)]
14 [Index("BareJid", "LegalId")]
15 [Index("BareJid", "State", "Timestamp")]
16 [Singleton]
17 public class LegalIdentityState
18 {
19 private string objectId = null;
22 private byte[] publicKey = null;
23 private IdentityState state = IdentityState.Created;
24 private DateTime timestamp = DateTime.MinValue;
25
30 {
31 }
32
38 {
39 this.legalId = LegalId;
40 }
41
45 [ObjectId]
46 public string ObjectId
47 {
48 get => this.objectId;
49 set => this.objectId = value;
50 }
51
56 {
57 get => this.bareJid;
58 set => this.bareJid = value;
59 }
60
65 {
66 get => this.legalId;
67 set => this.legalId = value;
68 }
69
73 [DefaultValueNull]
74 public byte[] PublicKey
75 {
76 get => this.publicKey;
77 set => this.publicKey = value;
78 }
79
84 {
85 get => this.state;
86 set => this.state = value;
87 }
88
92 public DateTime Timestamp
93 {
94 get => this.timestamp;
95 set => this.timestamp = value;
96 }
97
99 public override string ToString()
100 {
101 StringBuilder sb = new StringBuilder();
102
103 sb.Append(this.bareJid);
104 sb.Append(", ");
105 sb.Append(this.legalId);
106 sb.Append(", ");
107 sb.Append(this.state.ToString());
108 sb.Append(", ");
109 sb.Append(this.timestamp.ToString());
110
111 if (!(this.publicKey is null))
112 {
113 sb.Append(", ");
114 sb.Append(Convert.ToBase64String(this.publicKey));
115 }
116
117 return sb.ToString();
118 }
119 }
120}
Represents a case-insensitive string.
static readonly CaseInsensitiveString Empty
Empty case-insensitive string
IdentityState
Lists recognized legal identity states.
TypeNameSerialization
How the type name should be serialized.