2using System.Collections.Generic;
3using System.Threading.Tasks;
25 : base(
"Crypto/GetAlgorithms",
26 new KeyValuePair<Type,
Expression>(typeof(Dictionary<string, object>), new
Expression(jsonPattern)),
46 List<NamedDictionary<string, object>> Algorithms =
new List<NamedDictionary<string, object>>();
54 {
"localName", Endpoint.LocalName },
55 {
"namespace", Endpoint.Namespace },
56 {
"securityStrength", Endpoint.SecurityStrength },
57 {
"safe", Endpoint.Safe },
58 {
"slow", Endpoint.Slow },
59 {
"score", Endpoint.Score }
66 {
"Algorithms", Algorithms.ToArray() }
70 private readonly
static Dictionary<string, EllipticCurveEndpoint> endpoints =
new Dictionary<string, EllipticCurveEndpoint>();
76 Types.OnInvalidated += (Sender, e) =>
86 private static void GetEndpointsLocked()
105 string Fqn = Endpoint.Namespace +
"#" + Endpoint.
LocalName;
125 if (Namespace.StartsWith(
"urn:ieee:"))
126 Namespace = Namespace.Replace(
"urn:ieee:",
"urn:nf:");
130 return endpoints.TryGetValue(Namespace +
"#" + LocalName, out Algorithm);
146 if (Endpoint.
Curve.CurveName == CurveName)
148 Algorithm = Endpoint;
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.
Static class managing the application event log. Applications and services log events on this static ...
static void Exception(Exception Exception, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, params KeyValuePair< string, object >[] Tags)
Logs an exception. Event type will be determined by the severity of the exception.
Represents an HTTP request.
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,...
Abstract base class for Elliptic Curve endpoints.
EllipticCurve Curve
Elliptic Curve
Static class that dynamically manages types and interfaces available in the runtime environment.
static object Instantiate(Type Type, params object[] Arguments)
Returns an instance of the type Type . If one needs to be created, it is. If the constructor requires...
static Type[] GetTypesImplementingInterface(string InterfaceFullName)
Gets all types implementing a given interface.
Class managing a script expression.
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
Gets available cryptographic algorithms.
static bool TryGetAlgorithm(string LocalName, string Namespace, out EllipticCurveEndpoint Algorithm)
Tries to get an algorithm given its fully qualified name.
static bool TryGetAlgorithm(string CurveName, out EllipticCurveEndpoint Algorithm)
Tries to get an algorithm given its corresponding curve name.
override async Task POST(HttpRequest Request, HttpResponse Response, Dictionary< string, IElement > Parameters)
Executes the POST method on the resource.
GetAlgorithms()
Gets available cryptographic algorithms.
Abstract base class for End-to-End encryption schemes.
bool SupportsSignatures
If signatures are supported.
bool SupportsSharedSecrets
If shared secrets can be calculated from the endpoints keys.
string LocalName
Local name of the E2E endpoint