StringExtensionsDecrypt(String, Byte, Byte, Encoding) Method
Decrypts an encrypted base64 string
data by the
Aes algorithm using the provided
key and initialization vector.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
public static string Decrypt(
this string data,
byte[] key,
byte[] iv,
Encoding? encoding = null
)
<ExtensionAttribute>
Public Shared Function Decrypt (
data As String,
key As Byte(),
iv As Byte(),
Optional encoding As Encoding = Nothing
) As String
public:
[ExtensionAttribute]
static String^ Decrypt(
String^ data,
array<unsigned char>^ key,
array<unsigned char>^ iv,
Encoding^ encoding = nullptr
)
[<ExtensionAttribute>]
static member Decrypt :
data : string *
key : byte[] *
iv : byte[] *
?encoding : Encoding
(* Defaults:
let _encoding = defaultArg encoding null
*)
-> string
- data String
- The encrypted text in base64 format.
- key Byte
- Key of decryption.
- iv Byte
- The initialization vector to be used for decryption.
- encoding Encoding (Optional)
- The Encoding of the decrypted plain text.
If , then the native UTF-16 encoding of the string type is assumed. This parameter is optional.
Default value: .
StringThe decrypted plain text.In Visual Basic and C#, you can call this method as an instance method on any object of type
String. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).