Example #1
0
 public static void ThrowIfClientCredentialsIsNull(TenantManagementServiceClient proxy)
 {
     if (proxy.ClientCredentials == null)
     {
         throw new ImportTpdException("proxy.ClientCredentials is unexpectedly null", null);
     }
 }
Example #2
0
        protected virtual ITenantManagementService CreateRmsOnlineWebServiceProxy(X509Certificate2 authenticationCertificate)
        {
            TenantManagementServiceClient tenantManagementServiceClient = new TenantManagementServiceClient(new WSHttpBinding
            {
                SendTimeout            = RmsOnlineConstants.SendTimeout,
                ReceiveTimeout         = RmsOnlineConstants.ReceiveTimeout,
                ReaderQuotas           = RmsOnlineConstants.ReaderQuotas,
                MaxReceivedMessageSize = RmsOnlineConstants.MaxReceivedMessageSize,
                Name     = RmsOnlineConstants.BindingName,
                Security = RmsOnlineConstants.Security
            }, new EndpointAddress(this.rmsOnlineKeySharingLocation, new AddressHeader[0]));

            RmsUtil.ThrowIfClientCredentialsIsNull(tenantManagementServiceClient);
            if (tenantManagementServiceClient.ClientCredentials != null)
            {
                tenantManagementServiceClient.ClientCredentials.ClientCertificate.Certificate = authenticationCertificate;
            }
            return(tenantManagementServiceClient);
        }