public void StoreKey(string bucket, string handle, CryptoKey key) { var keyRow = new SymmetricCryptoKey { Bucket = bucket, Handle = handle, Secret = key.Key, ExpiresUtc = key.ExpiresUtc, }; MvcApplication.DataContext.AddToSymmetricCryptoKeys(keyRow); MvcApplication.DataContext.SaveChanges(); }
/// <summary> /// Create a new SymmetricCryptoKey object. /// </summary> /// <param name="bucket">Initial value of the Bucket property.</param> /// <param name="handle">Initial value of the Handle property.</param> /// <param name="expiresUtc">Initial value of the ExpiresUtc property.</param> /// <param name="secret">Initial value of the Secret property.</param> public static SymmetricCryptoKey CreateSymmetricCryptoKey(global::System.String bucket, global::System.String handle, global::System.DateTime expiresUtc, global::System.Byte[] secret) { SymmetricCryptoKey symmetricCryptoKey = new SymmetricCryptoKey(); symmetricCryptoKey.Bucket = bucket; symmetricCryptoKey.Handle = handle; symmetricCryptoKey.ExpiresUtc = expiresUtc; symmetricCryptoKey.Secret = secret; return symmetricCryptoKey; }
/// <summary> /// Deprecated Method for adding a new object to the SymmetricCryptoKeys EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSymmetricCryptoKeys(SymmetricCryptoKey symmetricCryptoKey) { base.AddObject("SymmetricCryptoKeys", symmetricCryptoKey); }