4using System.Threading.Tasks;
33 : base(
"Legal/PetitionId",
34 new KeyValuePair<Type,
Expression>(typeof(Dictionary<string, object>), new
Expression(jsonPattern)),
54 string KeyId = (string)Parameters[
"PKeyId"].AssociatedObjectValue;
55 if (
string.IsNullOrEmpty(KeyId))
82 string PetitionId = (string)Parameters[
"PPetitionId"].AssociatedObjectValue;
83 string Purpose = (string)Parameters[
"PPurpose"].AssociatedObjectValue;
84 string KeySignature = (string)Parameters[
"PKeySignature"].AssociatedObjectValue;
85 string RequestSignature = (string)Parameters[
"PRequestSignature"].AssociatedObjectValue;
87 StringBuilder sb =
new StringBuilder();
102 sb.Append(KeySignature);
115 string s3 = sb.ToString();
117 string s = Convert.ToBase64String(
120 Encoding.UTF8.GetBytes(s3)));
122 if (s != RequestSignature)
124 string Msg =
"Request Signature invalid.";
131 if (User.
UserName != Identity.Account)
136 LegalComponent.ClientInformation ClientInfo = await
XmppServerModule.Legal.GetNetworkIdentity(RemoteId,
true,
false, Identity.Version);
139 XmppServerModule.Legal.IdentityAuthorization(RemoteJid, From, LegalId,
true);
140 Dictionary<string, string> AttachmentUrls =
XmppServerModule.Legal.GetAttachmentUrls(Identity);
142 StringBuilder Msg =
new StringBuilder();
144 Msg.Append(
"<petitionIdentityMsg id=\"");
146 Msg.Append(
"\" pid=\"");
148 Msg.Append(
"\" from=\"");
150 Msg.Append(
"\" purpose=\"");
152 Msg.Append(
"\" clientEp=\"");
154 Msg.Append(
"\" xmlns=\"");
157 Identity.Serialize(Msg,
false,
true,
true,
true,
true,
true,
true, AttachmentUrls,
XmppServerModule.Legal);
158 Msg.Append(
"</petitionIdentityMsg>");
A Named dictionary is a dictionary, with a local name and a namespace. Use it to return content that ...
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.
Task Return(Exception ex)
Returns an error to the client.
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.
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.
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.
Legal (digital identities, smart contracts) 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.