コード例 #1
0
        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);
        }
コード例 #2
0
 public Aes() : this(AesConfiguration.FromFile("crypto.config"))
 {
 }
コード例 #3
0
 public Aes(AesConfiguration configuration)
 {
     this.configuration = configuration;
 }