This method initializes the VC class with information such as: VC name, and client certificate. All calls using VC or Scope will use this information when communicating with Cosmos. This method can be called multiple times to change the information. the successive calls should accept https url for cert-based authentication to take effect.

Namespace: VcClient
Assembly: VcClient (in VcClient.dll) Version: 1.0.0.0 (1.8.400.4142)

Syntax

C#
public static void Setup(
	string vcName,
	X509Certificate2 cert
)
Visual Basic
Public Shared Sub Setup ( _
	vcName As String, _
	cert As X509Certificate2 _
)
Visual C++
public:
static void Setup(
	String^ vcName, 
	X509Certificate2^ cert
)

Parameters

vcName
Type: String
VC name in "http://" or "vc://" format.
cert
Type: X509Certificate2
client certificate that is attached in http request. client certificate authentication is exercised.

Examples

In the following example, the clientCert is retrieved with AP PKI Helper API ApLookupLocalCert After the call to Setup, VC is configured with the certificate. In the call AppendFile, client certificate is attached in the http request and client certificate is authenticated by Cosmos Service.
CopyC#
var clientCert = ApPkiClient.ApLookupLocalCert(ApAuthType.Client, ApLookupFlags.MfCertOnly);
VC.Setup(@"https://cosmos.osdinfra.net/cosmos/MyVc", clientCert);
VC.AppendFile(@"https://cosmos.osdinfra.net/cosmos/MyVc/file", "file", false);

See Also