示例#1
0
 public ProtectedKey Read(Stream protectedKeyStream, DataProtectionScope protectionScope)
 {
     this.ValidateKeyVersion(protectedKeyStream);
     return(ProtectedKey.CreateFromEncryptedKey(this.ReadEncryptedKey(protectedKeyStream), protectionScope));
 }
示例#2
0
        public static void Write(Stream outputStream, byte[] encryptedKey, DataProtectionScope dpapiProtectionScope)
        {
            ProtectedKey key = ProtectedKey.CreateFromEncryptedKey(encryptedKey, dpapiProtectionScope);

            Write(outputStream, key);
        }