Example #1
0
 public UserKeyGenerator(IKeyGenerator generator, int size = 128)
 {
     _key = generator.GetBytes(size);
 }
Example #2
0
 /// <summary>
 /// Creates a new instance of the DefaultHmacProvider type
 /// </summary>
 /// <param name="keyGenerator">Key generator to use to generate the key</param>
 public DefaultHmacProvider(IKeyGenerator keyGenerator)
 {
     this.key = keyGenerator.GetBytes(PreferredKeySize);
 }
 /// <summary>
 /// Creates a new instance of the RijndaelEncryptionProvider class
 /// </summary>
 /// <param name="keyGenerator">Key generator to use to generate the key and iv</param>
 public RijndaelEncryptionProvider(IKeyGenerator keyGenerator)
 {
     this.key = keyGenerator.GetBytes(32);
     this.iv = keyGenerator.GetBytes(16);
 }
 /// <summary>
 /// Creates a new instance of the RijndaelEncryptionProvider class
 /// </summary>
 /// <param name="keyGenerator">Key generator to use to generate the key and iv</param>
 public RijndaelEncryptionProvider(IKeyGenerator keyGenerator)
 {
     this.key = keyGenerator.GetBytes(32);
     this.iv  = keyGenerator.GetBytes(16);
 }
Example #5
0
 public string getKey()
 {
     return(Convert.ToBase64String(_keyGenerator.GetBytes(1)));
 }
Example #6
0
 /// <summary>
 /// Creates a new instance of the DefaultHmacProvider type
 /// </summary>
 /// <param name="keyGenerator">Key generator to use to generate the key</param>
 public DefaultHmacProvider(IKeyGenerator keyGenerator)
 {
     this.key = keyGenerator.GetBytes(PreferredKeySize);
 }