2using System.Collections.Generic;
4using System.Threading.Tasks;
32 : base(
"Legal/PetitionId",
33 new KeyValuePair<Type,
Expression>(typeof(Dictionary<string, object>), new
Expression(jsonPattern)),
53 string KeyId = (string)Parameters[
"PKeyId"].AssociatedObjectValue;
54 if (
string.IsNullOrEmpty(KeyId))
81 string PetitionId = (string)Parameters[
"PPetitionId"].AssociatedObjectValue;
82 string Purpose = (string)Parameters[
"PPurpose"].AssociatedObjectValue;
83 string KeySignature = (string)Parameters[
"PKeySignature"].AssociatedObjectValue;
84 string RequestSignature = (string)Parameters[
"PRequestSignature"].AssociatedObjectValue;
86 StringBuilder sb =
new StringBuilder();
101 sb.Append(KeySignature);
114 string s3 = sb.ToString();
116 string s = Convert.ToBase64String(
119 Encoding.UTF8.GetBytes(s3)));
121 if (s != RequestSignature)
123 string Msg =
"Request Signature invalid.";
130 if (User.
UserName != Identity.Account)
135 LegalComponent.ClientInformation ClientInfo = await
XmppServerModule.Legal.GetNetworkIdentity(RemoteId,
true,
false, Identity.Version);
138 XmppServerModule.Legal.IdentityAuthorization(RemoteJid, From, LegalId,
true);
139 Dictionary<string, string> AttachmentUrls =
XmppServerModule.Legal.GetAttachmentUrls(Identity);
141 StringBuilder Msg =
new StringBuilder();
143 Msg.Append(
"<petitionIdentityMsg id=\"");
145 Msg.Append(
"\" pid=\"");
147 Msg.Append(
"\" from=\"");
149 Msg.Append(
"\" purpose=\"");
151 Msg.Append(
"\" clientEp=\"");
153 Msg.Append(
"\" xmlns=\"");
156 Identity.Serialize(Msg,
false,
true,
true,
true,
true,
true,
true, AttachmentUrls,
XmppServerModule.Legal);
157 Msg.Append(
"</petitionIdentityMsg>");
A Named dictionary is a dictionary, with a local name and a namespace. Use it to return content that ...
Static class managing loading of resources stored as embedded resources or in content files.
static string LoadResourceAsText(string ResourceName)
Loads a text resource from an embedded resource.
Helps with common XML-related tasks.
static string Encode(string s)
Encodes a string for use in XML.
Static class managing the runtime environment of the IoT Gateway.
static CaseInsensitiveString Domain
Domain name.
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repe...
The server understood the request, but is refusing to fulfill it. Authorization will not help and the...
Represents an HTTP request.
HttpRequestHeader Header
Request header.
string RemoteEndPoint
Remote end-point.
Represets a response of an HTTP client request.
async Task Return(object Object)
Returns an object to the client. This method can only be called once per response,...
The server has not found anything matching the Request-URI. No indication is given of whether the con...
XmppAddress MainDomain
Main/principal domain address
bool IsComponentDomain(CaseInsensitiveString Domain, bool IncludeAlternativeDomains)
Checks if a domain is the component domain, or optionally, an alternative component domain.
Contains information about one XMPP address.
bool IsBareJID
If the address is a Bare JID.
CaseInsensitiveString Domain
Domain
CaseInsensitiveString Address
XMPP Address
Task< bool > SendMessage(string Type, string Id, string From, string To, string Language, string ContentXml)
Sends a Message stanza to a recipient.
Represents a case-insensitive string.
static readonly CaseInsensitiveString Empty
Empty case-insensitive string
static bool IsNullOrEmpty(CaseInsensitiveString value)
Indicates whether the specified string is null or an CaseInsensitiveString.Empty string.
override string ToString()
Static interface for database persistence. In order to work, a database provider has to be assigned t...
This filter selects objects that conform to all child-filters provided.
This filter selects objects that have a named field equal to a given value.
Class managing a script expression.
Contains methods for simple hash calculations.
static byte[] ComputeHMACSHA256Hash(byte[] Key, byte[] Data)
Computes the HMAC-SHA-256 hash of a block of binary data.
string Password
Password of account
Account Account
Account object.
string UserName
User Name.
Provisioning and registry service component.
static string NamespaceLegalIdentity(NamespaceSet Version)
Returns the namespace for legal identities.
Abstract base class for agent resources supporting the POST method.
static AccountUser AssertUserAuthenticated(HttpRequest Request)
Makes sure the request is made by an authenticated API user.
const string AgentNamespace
https://waher.se/Schema/BrokerAgent.xsd
Contains an encrypted key for an agent.
string Namespace
Namespace of algorithm
string LocalName
Local Name of algorithm
Petitions access to a remote legal identity.
PetitionId()
Petitions access to a remote legal identity.
override async Task POST(HttpRequest Request, HttpResponse Response, Dictionary< string, IElement > Parameters)
Executes the POST method on the resource.
Service Module hosting the XMPP broker and its components.