Ich versuche, in einer Logik-App-Standard-Inline-C#-Aktion zu entschlüsseln, aber der Code, der in einer Funktions-App einwandfrei funktioniert, fällt in logischen Apps fehl. < /p>
Problem
< /code>
Der AES-Schlüssel wird in einem Azure-Taste als Basis 64-kodierter String
gespeichert (32 Byte → aes-256). Verschlüsselte Nutzlast.InvokeFunctionFailed
The function 'CSharp_wf-infringement-process-transaction_execute_csharp_script_code.csx'
failed with the error 'Exception binding parameter 'context'' when executing.
Please verify function code is valid.
< /code>
Inline C# Code im logischen App -Standard < /p>
// Add the required libraries
#r "Newtonsoft.Json"
#r "Microsoft.Azure.Workflows.Scripting"
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Microsoft.Azure.Workflows.Scripting;
using Newtonsoft.Json.Linq;
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
public static async Task Run(WorkflowContext context, ILogger log)
{
var composeOutput = (await context.GetActionResults("Compose").ConfigureAwait(false)).Outputs;
string KeyStringStr = composeOutput["KeyString"].ToString();
string Base64DataStr = composeOutput["Base64Data"].ToString();
if (string.IsNullOrEmpty(KeyStringStr))
throw new ArgumentException("AES key is missing.");
if (string.IsNullOrEmpty(Base64DataStr))
throw new ArgumentException("Ciphertext is missing.");
byte[] key = Convert.FromBase64String(KeyStringStr);
byte[] allBytes = Convert.FromBase64String(Base64DataStr);
byte[] iv = allBytes.Take(16).ToArray();
byte[] cipherBytes = allBytes.Skip(16).ToArray();
string decryptedText;
using (var aes = Aes.Create())
{
aes.Key = key;
aes.IV = iv;
aes.Mode = CipherMode.CBC;
aes.Padding = PaddingMode.PKCS7;
using var ms = new MemoryStream();
using (var cryptoStream = new CryptoStream(ms, aes.CreateDecryptor(), CryptoStreamMode.Write))
{
cryptoStream.Write(cipherBytes, 0, cipherBytes.Length);
cryptoStream.FlushFinalBlock();
}
decryptedText = Encoding.UTF8.GetString(ms.ToArray());
}
return new { DecryptedText = decryptedText };
}
public class Results
{
public string DecryptedText { get; set; }
}
Ich versuche, in einer Logik-App-Standard-Inline-C#-Aktion zu entschlüsseln, aber der Code, der in einer Funktions-App einwandfrei funktioniert, fällt in logischen Apps fehl. < /p> [code]Problem < /code>
Der AES-Schlüssel wird in einem Azure-Taste als Basis 64-kodierter String gespeichert (32 Byte → aes-256). Verschlüsselte Nutzlast.InvokeFunctionFailed The function 'CSharp_wf-infringement-process-transaction_execute_csharp_script_code.csx' failed with the error 'Exception binding parameter 'context'' when executing. Please verify function code is valid. < /code> Inline C# Code im logischen App -Standard < /p> // Add the required libraries #r "Newtonsoft.Json" #r "Microsoft.Azure.Workflows.Scripting"
using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Primitives; using Microsoft.Azure.Workflows.Scripting; using Newtonsoft.Json.Linq; using System; using System.IO; using System.Security.Cryptography; using System.Text;
public static async Task Run(WorkflowContext context, ILogger log) { var composeOutput = (await context.GetActionResults("Compose").ConfigureAwait(false)).Outputs;
if (string.IsNullOrEmpty(KeyStringStr)) throw new ArgumentException("AES key is missing."); if (string.IsNullOrEmpty(Base64DataStr)) throw new ArgumentException("Ciphertext is missing.");
using var ms = new MemoryStream(); using (var cryptoStream = new CryptoStream(ms, aes.CreateDecryptor(), CryptoStreamMode.Write)) { cryptoStream.Write(cipherBytes, 0, cipherBytes.Length); cryptoStream.FlushFinalBlock(); } decryptedText = Encoding.UTF8.GetString(ms.ToArray()); }
return new { DecryptedText = decryptedText }; }
public class Results { public string DecryptedText { get; set; } } [/code]
Erklärung.
Ich habe ein Problem mit der AES-256-CTR-Entschlüsselung mithilfe der React-native-aes-crypto-Bibliothek. Die Entschlüsselung funktioniert auf Android einwandfrei, schlägt jedoch auf iOS...
Ich habe eine JSON -Datei erhalten, die mit Golang AES/GCM/Nopadding verschlüsselt wurde, und ich habe AES/GCM/Nopadding mit Java implementiert. Ich kann die JSON -Datei verschlüsseln und sie...
Ziel:
MEZ/MESZ-Zeit in UTC umwandeln
Wird im folgenden logischen App-Ausdruck verwendet:
convertTimeZone('timestamp', 'sourceTimeZone', 'destinationTimeZone', 'format'?)
Meine Logik App-Design...
Ich entwickle eine Veranstaltungsplanungsanwendung und arbeite derzeit an einer Funktion, um einem Gast einen Artikel zuzuweisen. Abhängig von der Eingabe des Benutzers wird eine HTTP -Anforderung an...
Ich habe ein Problem für das Entschlüsseln von Token aus StandardintegrityToken in Einheit und Back-End-Verwenden Sie Firebase-Funktion.
Code in Einheit:
public async UniTask...