protected override async Task <Action <AsyncCodeActivityContext> > ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken) { // Inputs var encryptedText = EncryptedText.Get(context); /////////////////////////// // Add execution logic HERE string password = "******"; string plainText = Cipher.Decrypt(encryptedText, password); /////////////////////////// // Outputs return((ctx) => { PlainText.Set(ctx, plainText); }); }
protected override async Task <Action <AsyncCodeActivityContext> > ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken) { // Inputs var encryptionAlgorithm = EncryptionAlgorithm; var encryptedText = EncryptedText.Get(context); string plainText = null; /////////////////////////// // Add execution logic HERE string password = "******"; //Select algorithm switch (EncryptionAlgorithm) { //SHA256 case enumEncryptType.SHA256: plainText = Cipher.Decrypt(encryptedText, password); break; //AES case enumEncryptType.AES: plainText = AES.DecryptStringAES(encryptedText, password); break; //HMAC case enumEncryptType.HMAC: plainText = HMAC.SimpleDecryptWithPassword(encryptedText, password); break; //ASCIII case enumEncryptType.ASCIII: plainText = ASCIII.Decrypt(encryptedText); break; } // Outputs return((ctx) => { PlainText.Set(ctx, plainText); }); }