コード例 #1
0
 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;
        }