RestoreEncryptionKey 方法 (WMI MSReportServer_ConfigurationSetting)

将指定的加密密钥重新应用于报表服务器数据库。

语法

Public Sub RestoreEncryptionKey(ByRef KeyFile() As Integer, _
    ByRef Length As Int32, ByVal Password As String, _
    ByRef HRESULT As Int32, ByRef ExtendedErrors() As String)
public void RestoreEncryptionKey(out Byte[] KeyFile, out Int32 Length, 
            string Password, out Int32 HRESULT, out string[] ExtendedErrors);

参数

  • KeyFile[]
    [out] 包含已加密的加密密钥的数组。

  • Length
    [out] 该方法返回的数组长度。

  • Password
    用于对加密密钥进行加密的字符串。

  • HRESULT
    [out] 指示调用是成功还是失败的值。

  • ExtendedErrors[]
    [out] 一个字符串数组,包含此调用返回的其他错误。

返回值

返回 HRESULT,指示方法调用是成功还是失败。值 0 指示方法调用已成功。非零值指示已发生错误。

注释

如果报表服务器数据库中已经存在报表服务器的条目,则删除它。然后,使用指定的加密密钥和报表服务器的公钥创建新条目。

在调用清除加密密钥列表的 DeleteEncryptionKey 方法之后调用该方法最有效。

要求

**命名空间:**root\Microsoft\SqlServer\ReportServer\RS_<EncodedInstanceName>\v10\Admin

**平台:**Windows Server 2003 Datacenter Edition;Windows Server 2003 Enterprise Edition;Windows Server 2003 Standard Edition;Windows Vista;Windows XP Professional Service Pack 2 (SP2) 或 Service Pack 1 (SP1) 或者 Windows 2000(所有版本)