1using System.Security.Cryptography.X509Certificates;
28 this.NodeId = e.NodeId;
29 this.PartitionId = e.Partition;
30 this.SourceId = e.SourceId;
31 this.ServiceTokens = Convert(e.ServiceTokens,
TokenType.Service);
32 this.DeviceTokens = Convert(e.DeviceTokens,
TokenType.Device);
33 this.UserTokens = Convert(e.UserTokens,
TokenType.User);
42 int i, c = Tokens.Length;
45 for (i = 0; i < c; i++)
54 [DefaultValueStringEmpty]
60 [DefaultValueStringEmpty]
66 [DefaultValueStringEmpty]
104 bool Updated =
false;
111 lock (certificatesyByToken)
113 if (certificatesyByToken.TryGetValue(Token.
Token, out X509Certificate2? Certificate))
115 Token.FriendlyName = Certificate.FriendlyName;
116 Token.Certificate = Certificate.RawData;
129 private static readonly Dictionary<string, X509Certificate2> certificatesyByToken = [];
131 private async Task CertificateResponse(
object? Sender, CertificateEventArgs e)
133 if (e.Ok && e.State is ProvisioningToken Token)
135 lock (certificatesyByToken)
137 certificatesyByToken[Token.Token] = e.Certificate;
140 Token.FriendlyName = e.Certificate.FriendlyName;
141 Token.Certificate = e.Certificate.RawData;
Abstract base class of provisioning notification events.
A record of a token used in provisioning.
string? FriendlyName
Friendly Name of certificate
Abstract base class of thing notification events.
ThingNotificationEvent(NodeQuestionEventArgs e)
Abstract base class of thing notification events.
ProvisioningToken?[] DeviceTokens
Device tokens
string? SourceId
Source ID of thing.
string? NodeId
Node ID of thing.
string? PartitionId
Partition ID of thing.
ProvisioningToken?[] UserTokens
User tokens
ThingNotificationEvent()
Abstract base class of thing notification events.
override async Task Prepare()
Performs perparatory tasks, that will simplify opening the notification.
ProvisioningToken?[] ServiceTokens
Service tokens
string BareJid
Bare JID of sender.
Base class that references services in the app.
static IXmppService XmppService
The XMPP service for XMPP communication.
Static interface for database persistence. In order to work, a database provider has to be assigned t...
static async Task Update(object Object)
Updates an object in the database.
TokenType
Provisioning Token Type