コード例 #1
0
        private void SaveKeyPair(KeyAlgorithmPair pair, string xmlToUse)
        {
            KeyAlgorithmStorageProviderFactory factory  = new KeyAlgorithmStorageProviderFactory(CreateContext(xmlToUse));
            IKeyAlgorithmPairStorageProvider   provider = factory.Create();

            provider.Save(pair);
        }
コード例 #2
0
 public void CreateTest()
 {
     using (ConfigurationContext context = GetConfigurationContext(xmlString))
     {
         KeyAlgorithmStorageProviderFactory factory = new KeyAlgorithmStorageProviderFactory(context);
         IKeyAlgorithmPairStorageProvider   keyAlgorithmPairStorageProvider = factory.Create();
         Assert.IsNotNull(keyAlgorithmPairStorageProvider);
     }
 }
コード例 #3
0
        private void SetDataToBeEncrypted(ConfigurationContext context)
        {
            KeyAlgorithmStorageProviderFactory factory  = new KeyAlgorithmStorageProviderFactory(context);
            IKeyAlgorithmPairStorageProvider   provider = factory.Create();

            keyAlgorithmPair = provider.Load();
            if (null == keyAlgorithmPair)
            {
                throw new InvalidOperationException(SR.ExceptionKeyAlgorithmPairLoad);
            }

            encrypted = true;
        }