コード例 #1
0
ファイル: DesTests.cs プロジェクト: nnyamhon/corefx
 public static void DesCannotSetWeakKey()
 {
     using (DES d = new DESMinimal())
     {
         foreach (byte[] key in BadKeys())
         {
             Assert.Throws<CryptographicException>(() => d.Key = key);
         }
     }
 }
コード例 #2
0
ファイル: DesTests.cs プロジェクト: nnyamhon/corefx
 public static void DesDefaultCtor()
 {
     using (DES des = new DESMinimal())
     {
         Assert.Equal(64, des.KeySize);
         Assert.Equal(64, des.BlockSize);
         Assert.Equal(CipherMode.CBC, des.Mode);
         Assert.Equal(PaddingMode.PKCS7, des.Padding);
     }
 }