MS Common V 1.5 New paths for email-Service

This commit is contained in:
2024-03-15 11:47:14 +01:00
parent 21baf0bad0
commit a25b517445
14 changed files with 265 additions and 32 deletions

View File

@@ -1,9 +1,28 @@
Imports System.Drawing
Imports System.IO
Imports System.Security.Cryptography
Imports System.Text
Imports DevExpress.Utils.Svg
Imports EnvelopeGenerator.Common.Constants
Public Class Helpers
Private Shared key As String = "$xzBvyPETUS&amm8)D8x#)f;4%;?[BPd" ' Passwort-Schlüssel (16, 24, or 32 bytes)
Private Shared iv As String = "1wN&e[zrQ6_B7X/0" ' Initialisierungsvektor (16 bytes)
' Entschlüsselungsfunktion
Public Shared Function Decrypt(cipherText As String) As String
Dim aesAlg As Aes = Aes.Create()
aesAlg.Key = Encoding.UTF8.GetBytes(key)
aesAlg.IV = Encoding.UTF8.GetBytes(iv)
Dim decryptor As ICryptoTransform = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV)
Dim cipherBytes As Byte() = Convert.FromBase64String(cipherText)
Dim msDecrypt As New IO.MemoryStream(cipherBytes)
Using csDecrypt As New CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)
Using srDecrypt As New IO.StreamReader(csDecrypt)
Return srDecrypt.ReadToEnd()
End Using
End Using
End Function
''' <summary>
''' Encodes the EnvelopeUUID and the ReceiverSignature into an EnvelopeKey