private void SaveKeyPair(KeyAlgorithmPair pair, string xmlToUse)
 {
     KeyAlgorithmStorageProviderFactory factory = new KeyAlgorithmStorageProviderFactory(CreateContext(xmlToUse));
     IKeyAlgorithmPairStorageProvider provider = factory.Create();
     provider.Save(pair);
 }
예제 #2
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;
        }