public override SymmetricCryptoProviderData GetSymmetricCryptoProviderData(string instanceName)
 {
     DpapiSymmetricCryptoProviderData data = new DpapiSymmetricCryptoProviderData();
     data.Name = "name";
     DpapiSettingsData settingsData = new DpapiSettingsData();
     settingsData.Mode = DpapiStorageMode.Machine;
     settingsData.Entropy = this.entropy;
     data.DataProtectionMode = settingsData;
     return data;
 }
Пример #2
0
        public void Properties()
        {
            DpapiStorageMode mode = DpapiStorageMode.Machine;
            byte[] entropy = new byte[] {0, 1, 2, 3, 4};

            DpapiSettingsData data = new DpapiSettingsData();
            data.Mode = mode;
            data.Entropy = entropy;

            Assert.AreEqual(mode, data.Mode);
            Assert.AreEqual(entropy, data.Entropy);
        }
 /// <summary>
 /// <para>Initialize a new instance of the <see cref="FileKeyAlgorithmPairStorageProviderData"/> class with a name, fully qualified type name, file path and the DPAPI settings.</para>
 /// </summary>
 /// <param name="name">
 /// <para>The name of the storage provider.</para>
 /// </param>
 /// <param name="path">
 /// <para>The path to the file to store the pair.</para>
 /// </param>
 /// <param name="dpapiSettings">
 /// <para>A <see cref="DpapiSettingsData"/> object.</para>
 /// </param>
 public FileKeyAlgorithmPairStorageProviderData(string name, string path, DpapiSettingsData dpapiSettings) : base(name)
 {
     this.path          = path;
     this.dpapiSettings = dpapiSettings;
 }
 /// <summary>
 /// <para>Initializes a new instance of the <see cref="DpapiSymmetricCryptoProviderData"/> class with a name.</para>
 /// </summary>
 /// <param name="name">The name for the <see cref="DpapiSymmetricCryptoProviderData"/>.</param>
 /// <param name="data">The <see cref="DpapiSettingsData"/> for the provider.</param>
 public DpapiSymmetricCryptoProviderData(string name, DpapiSettingsData data)
     : base(name)
 {
     this.data = data;
 }
 /// <summary>
 /// <para>Initialize a new instance of the <see cref="FileKeyAlgorithmPairStorageProviderData"/> class with a name, fully qualified type name, file path and the DPAPI settings.</para>
 /// </summary>
 /// <param name="name">
 /// <para>The name of the storage provider.</para>
 /// </param>
 /// <param name="path">
 /// <para>The path to the file to store the pair.</para>
 /// </param>
 /// <param name="dpapiSettings">
 /// <para>A <see cref="DpapiSettingsData"/> object.</para>
 /// </param>
 public FileKeyAlgorithmPairStorageProviderData(string name, string path, DpapiSettingsData dpapiSettings)
     : base(name)
 {
     this.path = path;
     this.dpapiSettings = dpapiSettings;
 }