Skip to content
Snippets Groups Projects
Commit 4c833626 authored by Klaus Fischer's avatar Klaus Fischer
Browse files

Unsupported AesGcm in Mac

parent d9304e40
No related branches found
No related tags found
1 merge request!3Feature/440 mvp net sdk part 1
...@@ -43,7 +43,7 @@ var logger = LoggerFactory.Create( ...@@ -43,7 +43,7 @@ var logger = LoggerFactory.Create(
}).CreateLogger("FluentSenderTests"); }).CreateLogger("FluentSenderTests");
logger.Log(LogLevel.Information, logger.Log(LogLevel.Information,
"This is a dummy client to demonstrate the usage of the FitConnect SDK for .NET"); "This is a dummy client to demonstrate the usage of the FIT-Connect SDK for .NET");
client = new Client( client = new Client(
...@@ -52,7 +52,7 @@ client = new Client( ...@@ -52,7 +52,7 @@ client = new Client(
logger: logger); logger: logger);
Console.WriteLine( Console.WriteLine(
"This is a dummy client to demonstrate the usage of the FitConnect SDK for .NET"); "This is a dummy client to demonstrate the usage of the FIT-Connect SDK for .NET");
FluentSenderCall(); FluentSenderCall();
FluentSubscriberCall(); FluentSubscriberCall();
using System.Buffers.Text;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using IdentityModel; using IdentityModel;
using IdentityModel.Jwk; using Microsoft.IdentityModel.Tokens;
using JsonWebKey = IdentityModel.Jwk.JsonWebKey;
namespace FitConnect.Encryption; namespace FitConnect.Encryption;
public static class JsonWebKeyExtension { public static class JsonWebKeyExtension {
public static RSA ToRsaKey(this JsonWebKey jsonWebKey) { public static RSA ToRsaKey(this JsonWebKey jsonWebKey) {
var rsa = RSA.Create(); var rsa = RSA.Create();
rsa.ImportParameters(new RSAParameters { rsa.ImportParameters(new RSAParameters {
Modulus = Base64Url.Decode(jsonWebKey.N), Modulus = Base64Url.Decode(jsonWebKey.N),
Exponent = Base64Url.Decode(jsonWebKey.E), Exponent = Base64Url.Decode(jsonWebKey.E),
...@@ -18,7 +21,8 @@ public static class JsonWebKeyExtension { ...@@ -18,7 +21,8 @@ public static class JsonWebKeyExtension {
DQ = Base64Url.Decode(jsonWebKey.DQ), DQ = Base64Url.Decode(jsonWebKey.DQ),
InverseQ = Base64Url.Decode(jsonWebKey.QI), InverseQ = Base64Url.Decode(jsonWebKey.QI),
}); });
// = "RSA-OAEP-256"; // = "RSA-OAEP-256";
return rsa; return rsa;
} }
} }
...@@ -20,11 +20,6 @@ public class Sender : FunctionalBaseClass { ...@@ -20,11 +20,6 @@ public class Sender : FunctionalBaseClass {
} }
public static Sender Create(FitConnectEndpoints endpoints, ILogger? logger = null) { public static Sender Create(FitConnectEndpoints endpoints, ILogger? logger = null) {
// TODO: Remove certificate from here.
/*
new Sender(..., certificate) -> Nicht korrekt. Es gibt 1 Zertifikat muss pro Destination. Kann über die Submission API abgerufen werden (/v1/destinations/{destinationId}/keys/{keyId} mit keyId aus encryptionKid-Attribut in /v1/destinations/{destinationId})
*/
var container = DiContainer.GetContainer(endpoints, logger); var container = DiContainer.GetContainer(endpoints, logger);
return container.Resolve<Sender>(); return container.Resolve<Sender>();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment