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