public UserKeyGenerator(IKeyGenerator generator, int size = 128) { _key = generator.GetBytes(size); }
/// <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); }
public string getKey() { return(Convert.ToBase64String(_keyGenerator.GetBytes(1))); }
/// <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); }