Esempio n. 1
0
        /// <summary>
        /// Recupera o <see cref="System.ServiceModel.EndpointAddress"/> da instancia.
        /// </summary>
        /// <returns></returns>
        public System.ServiceModel.EndpointAddress GetEndpointAddress()
        {
            var endpointNode = GetEndpointNode();

            System.ServiceModel.EndpointIdentity identity = null;
            var identityNode = endpointNode["identity"];

            if (identityNode != null)
            {
                if (identityNode.Contains("dns"))
                {
                    identity = System.ServiceModel.EndpointIdentity.CreateDnsIdentity(identityNode["dns"].Parameters["value"]);
                }
                else if (identityNode.Contains("rsa"))
                {
                    identity = System.ServiceModel.EndpointIdentity.CreateRsaIdentity(identityNode["certificate"].Parameters["value"]);
                }
                else if (identityNode.Contains("userPrincipalName"))
                {
                    identity = System.ServiceModel.EndpointIdentity.CreateUpnIdentity(identityNode["userPrincipalName"].Parameters["value"]);
                }
                else if (identityNode.Contains("servicePrincipalName"))
                {
                    identity = System.ServiceModel.EndpointIdentity.CreateSpnIdentity(identityNode["servicePrincipalName"].Parameters["value"]);
                }
                else if (identityNode.Contains("certificate"))
                {
                    identity = System.ServiceModel.EndpointIdentity.CreateX509CertificateIdentity(new System.Security.Cryptography.X509Certificates.X509Certificate2(Convert.FromBase64String(identityNode["certificate"].Parameters["encodedValue"])));
                }
            }
            var endpoint = new System.ServiceModel.EndpointAddress(new Uri(this.Address), identity, new System.ServiceModel.Channels.AddressHeader[0]);

            FillObjectProperties(endpointNode, endpoint);
            return(endpoint);
        }
 public void InitializeFrom(System.ServiceModel.EndpointIdentity identity)
 {
 }
Esempio n. 3
0
 public abstract bool TryGetIdentity(System.ServiceModel.EndpointAddress reference, out System.ServiceModel.EndpointIdentity identity);
Esempio n. 4
0
 public abstract bool CheckAccess(System.ServiceModel.EndpointIdentity identity, System.IdentityModel.Policy.AuthorizationContext authContext);