DTSSignatureStatus 枚举
Describes the status of the digital signature.
命名空间: Microsoft.SqlServer.Dts.Runtime
程序集: Microsoft.SqlServer.ManagedDTS(在 Microsoft.SqlServer.ManagedDTS.dll 中)
语法
声明
Public Enumeration DTSSignatureStatus
用法
Dim instance As DTSSignatureStatus
public enum DTSSignatureStatus
public enum class DTSSignatureStatus
type DTSSignatureStatus
public enum DTSSignatureStatus
成员
成员名称 | 说明 | |
---|---|---|
Good | The signature is valid. | |
Invalid | The signature is not valid. | |
NotPresent | The signature is not present. | |
Untrusted | The signature is from an untrusted source. |
注释
A package can be signed with a digital signature. By using a digital signature, you can help ensure that only packages from trusted sources are opened and run. However, to ensure that Integration Services checks the digital signature when it loads a package, you must also do at least one of the following steps:
Set the value of a registry entry.
Set a command prompt option for the dtexec utility (dtexec.exe).
Set a property in SQL Server Data Tools.
Set a property in your code when you load or run packages programmatically. For example, the CheckSignatureOnLoad property of the Application class determines whether the signature is checked.
For more information, see 使用数字签名标识包的源.
重要提示 |
---|
When configured to check the signature of the package, Integration Services only checks whether the digital signature is present, is valid, and is from a trusted source. Integration Services does not check whether the package has been changed. |
示例
The following code example specifies through the Application class that the package will have its signature checked on load.
Application app = new Application();
app.CheckSignatureOnLoad = CheckSignatureOnLoad;
pkg = app.LoadPackage(mysavedPackagePath, null);
DTSSignatureStatus expectedStatus = DTSSignatureStatus.Good;
DTSSignatureStatus dss = pkg.CheckSignature();
if (dss != expectedStatus)
{
Console.WriteLine("Status not valid: found " + dss + ", expected " + expectedStatus);
}
Dim app As Application = New Application()
app.CheckSignatureOnLoad = CheckSignatureOnLoad
pkg = app.LoadPackage(mysavedPackagePath, Nothing)
Dim expectedStatus As DTSSignatureStatus = DTSSignatureStatus.Good
Dim dss As DTSSignatureStatus = pkg.CheckSignature()
If dss <> expectedStatus Then
Console.WriteLine("Status not valid: found " + dss + ", expected " + expectedStatus)
End If