public static ChannelFactory <IWSCertificationServiceChannel> CreateCertificationChannelFactory(Uri targetUri, EndpointAddress epa, LicenseIdentity identity, OrganizationId organizationId, IRmsLatencyTracker latencyTracker) { CustomBinding binding = RmsClientManagerUtils.CreateCustomBinding(organizationId, 0); ChannelFactory <IWSCertificationServiceChannel> channelFactory = new ChannelFactory <IWSCertificationServiceChannel>(binding, epa); channelFactory.Endpoint.Behaviors.Remove(typeof(ClientCredentials)); channelFactory.Endpoint.Behaviors.Add(new SamlClientCredentials(identity, organizationId, targetUri, Offer.IPCCertificationSTS, latencyTracker)); return(channelFactory); }