次の方法で共有


Package.LoadUserCertificateByName(String) メソッド

定義

証明書名に従ってパッケージの証明書を読み込みます。

public:
 void LoadUserCertificateByName(System::String ^ subjectName);
public void LoadUserCertificateByName (string subjectName);
member this.LoadUserCertificateByName : string -> unit
Public Sub LoadUserCertificateByName (subjectName As String)

パラメーター

subjectName
String

パッケージの証明書の名前です。

次のコード例では、名前を使用してユーザー証明書を読み込む構文を示します。

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  

namespace Package_API  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            Application app = new Application();  
            Package pkg = new Package();  

            pkg.Name = ("Cool Test on Loading Certificates");  
            pkg.LoadUserCertificateByName("\"VeriSign, Inc.\", VeriSign Trust Network, \"www.verisign.com/repository/RPA Incorp. by Ref.,LIAB.LTD(c)98\", Persona Not Validated, Digital ID Class 1 - Microsoft, <name>, <alias>");  

    pkg.LoadUserCertificateByHash(pkg.CertificateObject.GetCertHash());  

            // Save signed package  to change_this.dtsx  
            app.SaveToXml("change_this.dtxs", pkg, null);  
            app.CheckSignatureOnLoad = false;  
            pkg = app.LoadPackage("change_this.dtxs", null);  
            DTSSignatureStatus dss = pkg.CheckSignature();  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Class Program  
    Shared Sub Main(ByVal args() As String)  
        Dim app As New Application()  
        Dim pkg As New Package()  

        pkg.Name = "Cool Test on Loading Certificates"  
        pkg.LoadUserCertificateByName("""VeriSign, Inc."", VeriSign Trust Network, ""www.verisign.com/repository/RPA Incorp. by Ref.,LIAB.LTD(c)98"", Persona Not Validated, Digital ID Class 1 - Microsoft, <name>, <alias>")  
        pkg.LoadUserCertificateByHash(pkg.CertificateObject.GetCertHash())  

        ' Save signed package  to change_this.dtsx  
        app.SaveToXml("change_this.dtxs", pkg, Nothing)  
        app.CheckSignatureOnLoad = False  
        pkg = app.LoadPackage("change_this.dtxs", Nothing)  
        Dim dss As DTSSignatureStatus = pkg.CheckSignature()  
    End Sub  
End Class  

適用対象