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.CertificateContext Property

 

Applies To: SQL Server 2016 Preview

Gets or sets the certificate context.

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

[BrowsableAttribute(false)]
public long CertificateContext { get; set; }

Property Value

Type: System.Int64

The certificate context.

You must include a reference to the System.Security.Cryptography.X509Certificates assembly to set the value.

Legacy Code Example

The following example loads a package, and then retrieves several package properties, including the certificate context for the package.

Class PackageTest
    {
        static void Main(string[] args)
        {
            // The variable pkg points to the location of the
            // ExecuteProcess package sample
            // installed with the samples.
            string pkg = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";
            
            Application app = new Application();
            Package p = app.LoadPackage(pkg, null);
    
            // Once the package is loaded, this sample can query 
            // on several properties
            long cc = p.CertificateContext;
            string cfn = p.CheckpointFileName;
            DTSProtectionLevel pl = p.ProtectionLevel;
            DTSPackageType dpt = p.PackageType;

            Console.WriteLine("CertificateContext = " + cc);
            Console.WriteLine("CheckpointFileName = " + cfn);
            Console.WriteLine("ProtectionLevel = " + pl);
            Console.WriteLine("PackageType = " + dpt);
        }
    }

Sample Output:

CertificateContext = 0

CheckpointFileName =

ProtectionLevel = EncryptSensitiveWithUserKey

PackageType = Default

Return to top
Show:
© 2015 Microsoft