Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Package.LoadUserCertificateByHash Method (Byte[])


Loads the certificate for the package according to the certificate hash.

Namespace:   Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)

public void LoadUserCertificateByHash(
	byte[] certHash


Type: System.Byte[]

A byte array that contains the hash of the certificate for the package.

To obtain the byte hash code of a certificate, you can use the X509Certificate.GetCertHash Method from the System.Security.Cryptography.X509Certificates namespace.

The following code example shows the syntax to load a user certificate using the certificate hash.

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>");


            // 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();
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft