Skip to main content

AesUtils

Assembly: ServiceStack.Client.dll
View Source
Declaration
public static class AesUtils

Fields

KeySize

View Source
Declaration
public const int KeySize = 256

KeySizeBytes

View Source
Declaration
public const int KeySizeBytes = 32

BlockSize

View Source
Declaration
public const int BlockSize = 128

BlockSizeBytes

View Source
Declaration
public const int BlockSizeBytes = 16

Methods

CreateSymmetricAlgorithm()

View Source
Declaration
public static SymmetricAlgorithm CreateSymmetricAlgorithm()
Returns

System.Security.Cryptography.SymmetricAlgorithm

CreateKey()

View Source
Declaration
public static byte[] CreateKey()
Returns

System.Byte[]

CreateBase64Key()

View Source
Declaration
public static string CreateBase64Key()
Returns

System.String

CreateIv()

View Source
Declaration
public static byte[] CreateIv()
Returns

System.Byte[]

CreateKeyAndIv(out Byte[], out Byte[])

View Source
Declaration
public static void CreateKeyAndIv(out byte[] cryptKey, out byte[] iv)
Parameters
TypeName
System.Byte[]cryptKey
System.Byte[]iv

CreateCryptAuthKeysAndIv(out Byte[], out Byte[], out Byte[])

View Source
Declaration
public static void CreateCryptAuthKeysAndIv(out byte[] cryptKey, out byte[] authKey, out byte[] iv)
Parameters
TypeName
System.Byte[]cryptKey
System.Byte[]authKey
System.Byte[]iv

Encrypt(String, Byte[], Byte[])

View Source
Declaration
public static string Encrypt(string text, byte[] cryptKey, byte[] iv)
Returns

System.String

Parameters
TypeName
System.Stringtext
System.Byte[]cryptKey
System.Byte[]iv

Encrypt(Byte[], Byte[], Byte[])

View Source
Declaration
public static byte[] Encrypt(byte[] bytesToEncrypt, byte[] cryptKey, byte[] iv)
Returns

System.Byte[]

Parameters
TypeName
System.Byte[]bytesToEncrypt
System.Byte[]cryptKey
System.Byte[]iv

Decrypt(String, Byte[], Byte[])

View Source
Declaration
public static string Decrypt(string encryptedBase64, byte[] cryptKey, byte[] iv)
Returns

System.String

Parameters
TypeName
System.StringencryptedBase64
System.Byte[]cryptKey
System.Byte[]iv

Decrypt(Byte[], Byte[], Byte[])

View Source
Declaration
public static byte[] Decrypt(byte[] encryptedBytes, byte[] cryptKey, byte[] iv)
Returns

System.Byte[]

Parameters
TypeName
System.Byte[]encryptedBytes
System.Byte[]cryptKey
System.Byte[]iv