public static void CreateDefault(string certificateThumbprint, string filePath) { var config = new AesConfiguration { CertificateThumbprint = certificateThumbprint, BlockSize = 256, CipherMode = CipherMode.CBC, Padding = PaddingMode.PKCS7, EncryptedKey = Encrypt(GetRandomBytes(32), certificateThumbprint), EncryptedIv = Encrypt(GetRandomBytes(32), certificateThumbprint) }; byte[] bytes = XmlSerialization.Serialize(config); File.WriteAllBytes(filePath, bytes); }
public Aes() : this(AesConfiguration.FromFile("crypto.config")) { }
public Aes(AesConfiguration configuration) { this.configuration = configuration; }