xmlNames.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / xmlNames.cs / 1 / xmlNames.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------
using System;
using System.Collections.Generic; 
using System.Text;
using System.Xml; 
using IDT = Microsoft.InfoCards.Diagnostics.InfoCardTrace; 

 
namespace Microsoft.InfoCards
{
    internal sealed class XmlNames
    { 
        private XmlNames() { }
 
        internal sealed class Saml11 
        {
            private Saml11() { } 

            public const string DefaultPrefix = "saml";
            public const string Namespace = "urn:oasis:names:tc:SAML:1.0:assertion";
            public const string AltNamespace = "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1"; 
        }
        internal sealed class Saml10 
        { 
            private Saml10() { }
 
            public const string DefaultPrefix = "saml";
            public const string Namespace = "urn:oasis:names:tc:SAML:1.0:assertion";
            public const string Bearer = "urn:oasis:names:tc:SAML:1.0:cm:bearer";
        } 

        internal sealed class Xml 
        { 
            private Xml() { }
            public const string DefaultPrefix = "xml"; 
            public const string Namespace = "http://www.w3.org/XML/1998/namespace";
            public const string Language = "lang";
            public const string DateTimeFormat = "yyyy-MM-ddTHH:mm:ssZ";
        } 

        internal sealed class XmlSchema 
        { 
            private XmlSchema() { }
 
            public const string DefaultPrefix = "xsd";
            public const string Namespace = "http://www.w3.org/2001/XMLSchema";
            public const string SchemaLocation = "http://www.w3.org/2001/xml.xsd";
            public const string LocalSchemaLocation = "xml.xsd"; 
        }
        internal sealed class WSAddressing 
        { 
            private WSAddressing() { }
 
            public const string DefaultPrefix = "wsa";
            public const string Namespace = "http://www.w3.org/2005/08/addressing";
            public const string SchemaLocation = Namespace + "/addressing.xsd";
            public const string LocalSchemaLocation =  "addressing.xsd"; 
            public const string EndpointReference = "EndpointReference";
            public const string Address = "Address"; 
 
        }
        internal sealed class WSAddressing04 
        {
            private WSAddressing04() { }

            public const string DefaultPrefix = "wsa04"; 
            public const string Namespace = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
            public const string SchemaLocation = "http://schemas.xmlsoap.org/ws/2004/08/addressing/"; 
            public const string LocalSchemaLocation = "addressing04.xsd"; 

        } 

        internal sealed class WSPolicy
        {
            private WSPolicy() { } 

            public const string DefaultPrefix = "wsp"; 
            public const string Namespace = "http://schemas.xmlsoap.org/ws/2004/09/policy"; 
            public const string SchemaLocation = Namespace + "/ws-policy.xsd";
            public const string LocalSchemaLocation = "ws-policy.xsd"; 
            public const string Policy = "Policy";
            public const string AppliesTo = "AppliesTo";
        }
 
        internal enum WSSpecificationVersion
        { 
            WSPolicyXmlSoap2004, 
            WSPolicyW32007,
            WSTrustXmlSoap2005, 
            WSTrustOasis2007,
            WSSecurityPolicyXmlSoap2005,
            WSSecurityPolicyOasis2007
        } 

        internal interface IWSSpecification 
        { 
            WSSpecificationVersion Version { get; }
        } 

        internal interface IWSPolicy : IWSSpecification
        {
            string DefaultPrefix { get; } 
            string Namespace { get; }
            string SchemaLocation { get; } 
            string LocalSchemaLocation { get; } 
            string Policy { get; }
            string AppliesTo { get; } 
        }

        internal sealed class WSPolicyXmlSoap2004 : IWSPolicy
        { 
            public static WSPolicyXmlSoap2004 Instance = new WSPolicyXmlSoap2004();
 
            private WSPolicyXmlSoap2004() { } 

            public WSSpecificationVersion Version { get { return WSSpecificationVersion.WSPolicyXmlSoap2004; } } 

            public const string c_DefaultPrefix = "wsp2004";
            public const string c_Namespace = "http://schemas.xmlsoap.org/ws/2004/09/policy";
            public const string c_AppliesTo = "AppliesTo"; 

            public string DefaultPrefix { get { return c_DefaultPrefix; } } 
            public string Namespace { get { return c_Namespace; } } 
            public string SchemaLocation { get { return Namespace + "/ws-policy.xsd"; } }
            public string LocalSchemaLocation { get { return "ws-policy.xsd"; } } 
            public string Policy { get { return "Policy"; } }
            public string AppliesTo { get { return c_AppliesTo; } }
        }
 
        internal sealed class WSPolicyW32007 : IWSPolicy
        { 
            public static WSPolicyW32007 Instance = new WSPolicyW32007(); 

            private WSPolicyW32007() { } 

            public WSSpecificationVersion Version { get { return WSSpecificationVersion.WSPolicyW32007; } }

            public const string c_DefaultPrefix = "wsp2007"; 
            public const string c_Namespace = "http://www.w3.org/ns/ws-policy";
            public const string c_AppliesTo = "AppliesTo"; 
 
            public string DefaultPrefix { get { return c_DefaultPrefix; } }
            public string Namespace { get { return c_Namespace; } } 
            public string SchemaLocation { get { return "http://www.w3.org/2007/02/ws-policy.xsd"; } }
            public string LocalSchemaLocation { get { return "ws-policy-2007.xsd"; } }
            public string Policy { get { return "Policy"; } }
            public string AppliesTo { get { return c_AppliesTo; } } 
        }
 
        internal sealed class XmlEnc 
        {
            private XmlEnc() { } 

            public const string DefaultPrefix = "enc";
            public const string Namespace = "http://www.w3.org/2001/04/xmlenc#";
            public const string EncryptedData = "EncryptedData"; 
            public const string EncryptionMethod = "EncryptionMethod";
            public const string EncryptionProperties = "EncryptionProperties"; 
            public const string CipherData = "CipherData"; 
            public const string CipherValue = "CipherValue";
            public const string Encoding = "Encoding"; 
            public const string MimeType = "MimeType";
            public const string Type = "Type";
            public const string Id = "Id";
            public const string Algorithm = "Algorithm"; 
            public const string LocalSchemaLocation = "xenc-schema.xsd";
            public const string SchemaLocation = "http://www.w3.org/TR/xmlenc-core/xenc-schema.xsd"; 
        } 
        internal sealed class XmlDSig
        { 
            private XmlDSig() { }

            public const string DefaultPrefix = "dsig";
            public const string Namespace = "http://www.w3.org/2000/09/xmldsig#"; 
            public const string SchemaLocation = "http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd";
            public const string LocalSchemaLocation = "xmldsig-core-schema.xsd"; 
            public const string X509CertificateElement = "X509Certificate"; 
            public const string X509IssuerSerialElement = "X509IssuerSerial";
            public const string X509IssuerNameElement = "X509IssuerName"; 
            public const string X509SerialNumberElement = "X509SerialNumber";
            public const string X509DataElement = "X509Data";
            public const string RSAKeyValueElement = "RSAKeyValue";
            public const string Signature = "Signature"; 
            public const string KeyInfo = "KeyInfo";
            public const string KeyValue = "KeyValue"; 
        } 

        internal sealed class WSSecurityPolicy 
        {
            private WSSecurityPolicy() { }

            public const string DefaultPrefix = "sp"; 
            public const string Namespace = "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";
            public const string SchemaLocation = "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/ws-securitypolicy.xsd"; 
            public const string LocalSchemaLocation = "ws-securitypolicy.xsd"; 
            public const string RequestSecurityTokenTemplate = "RequestSecurityTokenTemplate";
        } 

        internal interface IWSSecurityPolicy : IWSSpecification
        {
            string DefaultPrefix { get; } 
            string Namespace { get; }
            string SchemaLocation { get; } 
            string LocalSchemaLocation { get; } 
            string RequestSecurityTokenTemplate { get; }
        } 

        internal sealed class WSSecurityPolicyXmlSoap2005 : IWSSecurityPolicy
        {
            public static WSSecurityPolicyXmlSoap2005 Instance = new WSSecurityPolicyXmlSoap2005(); 

            private WSSecurityPolicyXmlSoap2005() { } 
 
            public WSSpecificationVersion Version { get { return WSSpecificationVersion.WSSecurityPolicyXmlSoap2005; } }
 
            public const string c_Namespace = "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";
            public const string c_RequestSecurityTokenTemplate = "RequestSecurityTokenTemplate";

            public string DefaultPrefix { get { return "sp"; } } 
            public string Namespace { get { return c_Namespace; } }
            public string SchemaLocation { get { return "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/ws-securitypolicy.xsd"; } } 
            public string LocalSchemaLocation { get { return "ws-securitypolicy.xsd"; } } 
            public string RequestSecurityTokenTemplate { get { return c_RequestSecurityTokenTemplate; } }
        } 

        internal sealed class WSSecurityPolicyOasis2007 : IWSSecurityPolicy
        {
            public static WSSecurityPolicyOasis2007 Instance = new WSSecurityPolicyOasis2007(); 

            private WSSecurityPolicyOasis2007() { } 
 
            public WSSpecificationVersion Version { get { return WSSpecificationVersion.WSSecurityPolicyOasis2007; } }
 
            public const string c_Namespace = "http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512";
            public const string c_RequestSecurityTokenTemplate = "RequestSecurityTokenTemplate";

            public string DefaultPrefix { get { return "sp"; } } 
            public string Namespace { get { return c_Namespace; } }
            public string SchemaLocation { get { return "http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512/ws-securitypolicy-1.2.xsd"; } } 
            public string LocalSchemaLocation { get { return "ws-securitypolicy-1.2.xsd"; } } 
            public string RequestSecurityTokenTemplate { get { return c_RequestSecurityTokenTemplate; } }
        } 


        internal sealed class WSSecurityUtility
        { 
            private WSSecurityUtility() { }
 
            public const string DefaultPrefix = "wssu"; 
            public const string Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
            public const string SchemaLocation = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"; 
            public const string LocalSchemaLocation = "oasis-200401-wss-wssecurity-utility-1.0.xsd";
            public const string Created = "Created";
            public const string Expires = "Expires";
        } 

        internal sealed class WSSecurityExt 
        { 
            private WSSecurityExt() { }
 
            public const string DefaultPrefix = "wsse";
            public const string Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
            public const string SchemaLocation = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
            public const string LocalSchemaLocation = "oasis-200401-wss-wssecurity-secext-1.0.xsd"; 
            public const string Sha1ThumbprintKeyTypeValue = "http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1";
            // This is the incorrect SHA1 URI, which is being preserved for backward compbaility 
            public const string AltSha1ThumbprintKeyTypeValue = "http://docs.oasis-open.org/wss/2004/xx/oasis-2004xx-wss-soap-message-security-1.1#ThumbprintSHA1"; 
            public const string KeyIdentifierElement = "KeyIdentifier";
            public const string ValueTypeAttribute = "ValueType"; 

        }
        internal sealed class WSMetadataExchange
        { 
            private WSMetadataExchange() { }
            public const string DefaultPrefix = "wsmex"; 
            public const string Namespace = "http://schemas.xmlsoap.org/ws/2004/09/mex"; 
            public const string LocalSchemaLocation = "MetadataExchange.xsd";
            public const string SchemaLocation = "http://schemas.xmlsoap.org/ws/2004/09/mex/MetadataExchange.xsd"; 
        }
        internal sealed class Soap11
        {
            private Soap11() { } 
            public const string DefaultPrefix = "soap";
            public const string Namespace = "http://schemas.xmlsoap.org/soap/envelope/"; 
        } 
        internal sealed class Soap12
        { 
            private Soap12() { }
            public const string DefaultPrefix = "soap";
            public const string Namespace = "http://www.w3.org/2003/05/soap-envelope";
        } 

        internal sealed class WSIdentity 
        { 
            private WSIdentity() { }
 
            public const string DefaultPrefix = "wsid";
            public const string Namespace = "http://schemas.xmlsoap.org/ws/2005/05/identity";
            public const string LocalSchemaLocation = "identity.xsd";
            public const string ClaimElement = "ClaimType"; 
            public const string SupportedClaimTypeElement = "SupportedClaimType";
            public const string ProvisionAtElement = "ProvisionAt"; 
            public const string RequestBrowserToken = "RequestBrowserToken"; 
            public const string Identity = "Identity";
            public const string DictionaryUri = Namespace + "/claims"; 
            public const string SelfIssuerUri = Namespace + "/issuer/self";
            public static readonly Uri SelfIssuerUriValue = new Uri( SelfIssuerUri );
            public const string AnonymousIssuerUri = "http://schemas.microsoft.com/2005/12/ServiceModel/Addressing/Anonymous";
            public static readonly Uri AnonymousIssuerUriValue = new Uri( AnonymousIssuerUri ); 
            public const string PersonalCategoryUri = "http://icardissuer.microsoft.com/categories/identitycard";
            public const string UserNamePasswordAuth = Namespace + "/A12nMethod/UsernamePassword"; 
            public const string KerberosV5Auth = Namespace + "/A12nMethod/KerberosV5"; 
            public const string X509V3SoftAuth = Namespace + "/A12nMethod/X509V3Soft";
            public const string X509V3SmartCardAuth = Namespace + "/A12nMethod/X509V3SmartCard"; 
            public const string SelfIssuedAuth = Namespace + "/A12nMethod/SelfIssuedToken";
            public const string RequestDisplayTokenElement = "RequestDisplayToken";
            public const string RequestedDisplayTokenElement = "RequestedDisplayToken";
            public const string DisplayTokenElement = "DisplayToken"; 
            public const string DisplayTokenTextElement = "DisplayTokenText";
            public const string DisplayClaimElement = "DisplayClaim"; 
            public const string DisplayTagElement = "DisplayTag"; 
            public const string DisplayValueElement = "DisplayValue";
            public const string DescriptionElement = "Description"; 
            public const string InfoCardElement = "InformationCard";
            public const string RoamingInfoCardElement = "RoamingInformationCard";
            public const string InfoCardRefElement = "InformationCardReference";
            public const string CardNameElement = "CardName"; 
            public const string CardImageElement = "CardImage";
            public const string CardIdElement = "CardId"; 
            public const string CardVersionElement = "CardVersion"; 
            public const string IssuerNameElement = "IssuerName";
            public const string IssuerElement = "Issuer"; 
            public const string IssuerUriElement = "IssuerUri";
            public const string TimeIssuedElement = "TimeIssued";
            public const string TimeExpiresElement = "TimeExpires";
            public const string SupportedClaimTypeListElement = "SupportedClaimTypeList"; 
            public const string SupportedTokenTypeListElement = "SupportedTokenTypeList";
            public const string RequirePinProtectionElement = "RequirePinProtection"; 
            public const string TokenServiceListElement = "TokenServiceList"; 
            public const string TokenServiceElement = "TokenService";
            public const string UserCredentialElement = "UserCredential"; 
            public const string DisplayCredentialHintElement = "DisplayCredentialHint";
            public const string UserNamePasswordCredentialElement = "UsernamePasswordCredential";
            public const string X509V3CredentialElement = "X509V3Credential";
            public const string KerberosV5CredentialElement = "KerberosV5Credential"; 
            public const string SelfIssuedCredentialElement = "SelfIssuedCredential";
            public const string RequireAppliesToElement = "RequireAppliesTo"; 
            public const string UserNameElement = "Username"; 
            public const string PrivatePersonalIdentifierElement = "PrivatePersonalIdentifier";
            public const string MaxTokenAgeElement = "MaxTokenAge"; 
            public const string OpaqueEndPointElement = "OpaqueEndpoint";
            public const string UriAttribute = "Uri";
            public const string OptionalAttribute = "Optional";
            public const string MimeTypeAttribute = "MimeType"; 
            public const string MethodAttribute = "Method";
            public const string PrivacyNoticeAtElement = "PrivacyNotice"; 
            public const string PrivacyNoticeVersionAttribute = "Version"; 
            public const string IsManagedElement = "IsManaged";
            public const string MasterKeyElement = "MasterKey"; 
            public const string PinDigestElement = "PinDigest";
            public const string HashSaltElement = "HashSalt";
            public const string TimeLastUpdatedElement = "TimeLastUpdated";
            public const string ClaimValueElement = "ClaimValue"; 
            public const string RoamingStoreElement = "RoamingStore";
            public const string IsSelfIssuedElement = "IsSelfIssued"; 
            public const string StoreSaltElement = "StoreSalt"; 
            public const string IssuerIdElement = "IssuerId";
            public const string IterationCountElement = "IterationCount"; 
            public const string EncryptedStoreElement = "EncryptedStore";
            public const string BackgroundColorElement = "BackgroundColor";
            public const string UserPrincipalNameElement = "UserPrincipalName";
            public const string InfoCardMetaDataElement = "InformationCardMetaData"; 
            public const string InfoCardPrivateDataElement = "InformationCardPrivateData";
            public const string ClaimValueListElement = "ClaimValueList"; 
            public const string ValueElement = "Value"; 
            public const string ThumbprintUri = Namespace + "/keyThumbprintSHA1";
            public static readonly Uri NoProofKeyTypeValue = new Uri( Namespace + "/NoProofKey" ); 
            public const string ClientPseudonym = "ClientPseudonym";
            public const string PPID = "PPID";

            // 
            // WS Identity fault support.
            // 
            public const string FaultNamespace          = Namespace + "/fault"; 
            public const string FaultRefreshRequired    = "InformationCardRefreshRequired";
            public const string FaultMissingAppliesTo   = "MissingAppliesTo"; 
            public const string FaultInvalidProofKey    = "InvalidProofKey";
            public const string FaultUnknownReference   = "UnknownInformationCardReference";
            public const string FaultRequiredClaims     = "FailedRequiredClaims";
 
        }
 
        internal sealed class WSIdentity07 
        {
            private WSIdentity07() { } 

            public const string DefaultPrefix = "wsid07";
            public const string Namespace = "http://schemas.xmlsoap.org/ws/2007/01/identity";
            public const string LocalSchemaLocation = "ws-identity-2007.xsd"; 

            public const string IssuerInformation = "IssuerInformation"; 
            public const string IssuerInformationEntry = "IssuerInformationEntry"; 
            public const string EntryName = "EntryName";
            public const string EntryValue = "EntryValue"; 
            public const string RequireStrongRPIdentity = "RequireStrongRecipientIdentity";
        }

        internal sealed class WSTrust 
        {
            private WSTrust() { } 
 
            public const string DefaultPrefix = "wst";
            public const string Namespace = "http://schemas.xmlsoap.org/ws/2005/02/trust"; 
            public const string SchemaLocation = Namespace + "/ws-trust.xsd";
            public const string LocalSchemaLocation = "ws-trust.xsd";
            public const string ClaimsElement = "Claims";
            public const string TokenType = "TokenType"; 
            public const string EncryptWith = "EncryptWith";
            public const string CustomToken = "customToken"; 
            public const string Context = "Context"; 
            public const string KeyType = "KeyType";
            public const string KeySize = "KeySize"; 
            public const string UseKey = "UseKey";
            public const string SigAttribute = "Sig";
            public static readonly Uri KeyTypeSymmetric = new Uri( Namespace + "/SymmetricKey" );
            public static readonly Uri KeyTypeAsymmetric = new Uri( Namespace + "/PublicKey" ); 
            public const string RequestSecurityToken = "RequestSecurityToken";
            public const string RequestSecurityTokenAction = Namespace + "/RST/Issue"; 
            public const string RequestSecurityTokenResponseAction = Namespace + "/RSTR/Issue"; 
            public const string RequestedSecurityToken = "RequestedSecurityToken";
            public const string RequestedProofToken = "RequestedProofToken"; 
            public const string RequestSecurityTokenResponse = "RequestSecurityTokenResponse";
            public const string Lifetime = "Lifetime";
            public const string RequestedAttachedReference = "RequestedAttachedReference";
            public const string RequestedUnattachedReference = "RequestedUnattachedReference"; 
            public const string Entropy = "Entropy";
            public const string ComputedKey = "ComputedKey"; 
            public const string AuthenticationType = "AuthenticationType"; 
            public const string SignatureAlgorithm = "SignatureAlgorithm";
            public const string EncryptionAlgorithm = "EncryptionAlgorithm"; 
            public const string CanonicalizationAlgorithm = "CanonicalizationAlgorithm";
            public const string SignWith = "SignWith";
            public const string ComputedKeyAlgorithm = Namespace + "/CK/PSHA1";
            public const string RequestType = "RequestType"; 
            public const string IssueRequestType = Namespace + "/Issue";
        } 
 

        internal interface IWSTrust : IWSSpecification 
        {
            string DefaultPrefix { get; }
            string Namespace { get; }
            string SchemaLocation { get; } 
            string LocalSchemaLocation { get; }
            string ClaimsElement { get; } 
            string TokenType { get; } 
            string EncryptWith { get; }
            string CustomToken { get; } 
            string Context { get; }
            string KeyType { get; }
            string KeySize { get; }
            string UseKey { get; } 
            string SigAttribute { get; }
            string RequestSecurityToken { get; } 
            string RequestSecurityTokenAction { get; } 
            string RequestSecurityTokenResponseAction { get; }
            string RequestedSecurityToken { get; } 
            string RequestedProofToken { get; }
            string RequestSecurityTokenResponse { get; }
            string RequestSecurityTokenResponseCollection { get; }
            string Lifetime { get; } 
            string RequestedAttachedReference { get; }
            string RequestedUnattachedReference { get; } 
            string Entropy { get; } 
            string ComputedKey { get; }
            string AuthenticationType { get; } 
            string SignatureAlgorithm { get; }
            string EncryptionAlgorithm { get; }
            string CanonicalizationAlgorithm { get; }
            string SignWith { get; } 
            string ComputedKeyAlgorithm { get; }
            string RequestType { get; } 
            string IssueRequestType { get; } 
            string SecondaryParameters { get; }
            string KeyWrapAlgorithm{ get; } 
            string Dialect { get; }

            Uri KeyTypeSymmetric { get; }
            Uri KeyTypeAsymmetric { get; } 
            Uri KeyTypeBearer { get; }
        } 
 
        internal sealed class WSTrustXmlSoap2005 : IWSTrust
        { 
            public static WSTrustXmlSoap2005 Instance = new WSTrustXmlSoap2005();

            private WSTrustXmlSoap2005() { }
 
            public WSSpecificationVersion Version { get { return WSSpecificationVersion.WSTrustXmlSoap2005; } }
 
            // 
            // These strings are used in declaration of OperationContracts, which must be defined at design time.
            // Hence, these are simply constant duplicates of the values exposed by the properties below. 
            //
            public const string c_Namespace = "http://schemas.xmlsoap.org/ws/2005/02/trust";
            public const string c_RequestSecurityTokenAction = c_Namespace + "/RST/Issue";
            public const string c_RequestSecurityTokenResponseAction = c_Namespace + "/RSTR/Issue"; 

            public const string c_DefaultPrefix = "wst2005"; 
            public const string c_ClaimsElement = "Claims"; 
            public const string c_TokenType = "TokenType";
            public const string c_EncryptWith = "EncryptWith"; 
            public const string c_KeyType = "KeyType";
            public const string c_KeySize = "KeySize";
            public const string c_SignatureAlgorithm = "SignatureAlgorithm";
            public const string c_EncryptionAlgorithm = "EncryptionAlgorithm"; 
            public const string c_CanonicalizationAlgorithm = "CanonicalizationAlgorithm";
            public const string c_SignWith = "SignWith"; 
            public const string c_RequestType = "RequestType"; 
            public const string c_Dialect = "Dialect";
 
            public string DefaultPrefix { get { return c_DefaultPrefix; } }
            public string Namespace { get { return "http://schemas.xmlsoap.org/ws/2005/02/trust"; } }
            public string SchemaLocation { get { return Namespace + "/ws-trust.xsd"; } }
            public string LocalSchemaLocation { get { return "ws-trust.xsd"; } } 
            public string ClaimsElement { get { return c_ClaimsElement; } }
            public string TokenType { get { return c_TokenType; } } 
            public string EncryptWith { get { return c_EncryptWith; } } 
            public string CustomToken { get { return "customToken"; } }
            public string Context { get { return "Context"; } } 
            public string KeyType { get { return c_KeyType; } }
            public string KeySize { get { return c_KeySize; } }
            public string UseKey { get { return "UseKey"; } }
            public string SigAttribute { get { return "Sig"; } } 
            public string RequestSecurityToken { get { return "RequestSecurityToken"; } }
            public string RequestSecurityTokenAction { get { return Namespace + "/RST/Issue"; } } 
            public string RequestSecurityTokenResponseAction { get { return Namespace + "/RSTR/Issue"; } } 
            public string RequestedSecurityToken { get { return "RequestedSecurityToken"; } }
            public string RequestedProofToken { get { return "RequestedProofToken"; } } 
            public string RequestSecurityTokenResponse { get { return "RequestSecurityTokenResponse"; } }
            // PreSharp Bug: Property get methods should not throw exceptions.
#pragma warning suppress 56503
            public string RequestSecurityTokenResponseCollection { get { throw IDT.ThrowHelperError( new NotImplementedException() ); } } 
            public string Lifetime { get { return "Lifetime"; } }
            public string RequestedAttachedReference { get { return "RequestedAttachedReference"; } } 
            public string RequestedUnattachedReference { get { return "RequestedUnattachedReference"; } } 
            public string Entropy { get { return "Entropy"; } }
            public string ComputedKey { get { return "ComputedKey"; } } 
            public string AuthenticationType { get { return "AuthenticationType"; } }
            public string SignatureAlgorithm { get { return c_SignatureAlgorithm; } }
            public string EncryptionAlgorithm { get { return c_EncryptionAlgorithm; } }
            public string CanonicalizationAlgorithm { get { return c_CanonicalizationAlgorithm; } } 
            public string SignWith { get { return c_SignWith; } }
            public string ComputedKeyAlgorithm { get { return Namespace + "/CK/PSHA1"; } } 
            public string RequestType { get { return c_RequestType; } } 
            public string IssueRequestType { get { return Namespace + "/Issue"; } }
            // PreSharp Bug: Property get methods should not throw exceptions. 
#pragma warning suppress 56503
            public string SecondaryParameters { get { throw IDT.ThrowHelperError( new NotImplementedException() ); } }
            public string KeyWrapAlgorithm { get { throw IDT.ThrowHelperError( new NotImplementedException() ); } }
            public string Dialect { get { return c_Dialect; } } 

            public Uri KeyTypeSymmetric { get { return m_KeyTypeSymmetric; } } 
            public Uri KeyTypeAsymmetric { get { return m_KeyTypeAsymmetric; } } 

            // 
            // The Bearer key type is only defined in WS-Trust Oasis 2007.  If we need to specify no proof key
            // with this version of WS-Trust, use WSIdentity.NoProofKeyTypeValue.
            //
            public Uri KeyTypeBearer { get { return XmlNames.WSIdentity.NoProofKeyTypeValue; } } 

            private static readonly Uri m_KeyTypeSymmetric = new Uri( Instance.Namespace + "/SymmetricKey" ); 
            private static readonly Uri m_KeyTypeAsymmetric = new Uri( Instance.Namespace + "/PublicKey" ); 
        }
 
        internal sealed class WSTrustOasis2007 : IWSTrust
        {
            public static WSTrustOasis2007 Instance = new WSTrustOasis2007();
 
            private WSTrustOasis2007() { }
 
            public WSSpecificationVersion Version { get { return WSSpecificationVersion.WSTrustOasis2007; } } 

            // 
            // These strings are used in declaration of OperationContracts, which must be defined at design time.
            // Hence, these are simply constant duplicates of the values exposed by the properties below.
            //
            public const string c_Namespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512"; 
            public const string c_RequestSecurityTokenAction = c_Namespace + "/RST/Issue";
            public const string c_RequestSecurityTokenResponseAction = c_Namespace + "/RSTRC/IssueFinal"; 
 
            public const string c_DefaultPrefix = "wst";
            public const string c_ClaimsElement = "Claims"; 
            public const string c_TokenType = "TokenType";
            public const string c_EncryptWith = "EncryptWith";
            public const string c_KeyType = "KeyType";
            public const string c_KeySize = "KeySize"; 
            public const string c_SignatureAlgorithm = "SignatureAlgorithm";
            public const string c_EncryptionAlgorithm = "EncryptionAlgorithm"; 
            public const string c_CanonicalizationAlgorithm = "CanonicalizationAlgorithm"; 
            public const string c_SignWith = "SignWith";
            public const string c_RequestType = "RequestType"; 
            public const string c_SecondaryParameters = "SecondaryParameters";
            public const string c_KeyWrapAlgorithm = "KeyWrapAlgorithm";
            public const string c_Dialect = "Dialect";
 
            public string DefaultPrefix { get { return c_DefaultPrefix; } }
            public string Namespace { get { return "http://docs.oasis-open.org/ws-sx/ws-trust/200512"; } } 
            public string SchemaLocation { get { return Namespace + "/ws-trust-1.3.xsd"; } } 
            public string LocalSchemaLocation { get { return "ws-trust-1.3.xsd"; } }
            public string ClaimsElement { get { return c_ClaimsElement; } } 
            public string TokenType { get { return c_TokenType; } }
            public string EncryptWith { get { return c_EncryptWith; } }
            public string CustomToken { get { return "customToken"; } }
            public string Context { get { return "Context"; } } 
            public string KeyType { get { return c_KeyType; } }
            public string KeySize { get { return c_KeySize; } } 
            public string UseKey { get { return "UseKey"; } } 
            public string SigAttribute { get { return "Sig"; } }
            public string RequestSecurityToken { get { return "RequestSecurityToken"; } } 
            public string RequestSecurityTokenAction { get { return Namespace + "/RST/Issue"; } }
            //
            // Note: the actual response action is ".../RSTR/Issue", however its definition is changed for this version of WS-Trust.
            // We are to now interpret ".../RSTR/Issue" as a response containing a challenge.  Since Cardspace V1 does not support 
            // intermediate challenges in the RST/RSTR exchange, we must look explicitly for the ".../RSTRC/IssueFinal" action.
            // 
            public string RequestSecurityTokenResponseAction { get { return Namespace + "/RSTRC/IssueFinal"; } } 
            public string RequestedSecurityToken { get { return "RequestedSecurityToken"; } }
            public string RequestedProofToken { get { return "RequestedProofToken"; } } 
            public string RequestSecurityTokenResponse { get { return "RequestSecurityTokenResponse"; } }
            public string RequestSecurityTokenResponseCollection { get { return "RequestSecurityTokenResponseCollection"; } }
            public string Lifetime { get { return "Lifetime"; } }
            public string RequestedAttachedReference { get { return "RequestedAttachedReference"; } } 
            public string RequestedUnattachedReference { get { return "RequestedUnattachedReference"; } }
            public string Entropy { get { return "Entropy"; } } 
            public string ComputedKey { get { return "ComputedKey"; } } 
            public string AuthenticationType { get { return "AuthenticationType"; } }
            public string SignatureAlgorithm { get { return c_SignatureAlgorithm; } } 
            public string EncryptionAlgorithm { get { return c_EncryptionAlgorithm; } }
            public string CanonicalizationAlgorithm { get { return c_CanonicalizationAlgorithm; } }
            public string SignWith { get { return c_SignWith; } }
            public string ComputedKeyAlgorithm { get { return Namespace + "/CK/PSHA1"; } } 
            public string RequestType { get { return c_RequestType; } }
            public string IssueRequestType { get { return Namespace + "/Issue"; } } 
            public string SecondaryParameters { get { return c_SecondaryParameters; } } 
            public string KeyWrapAlgorithm { get { return c_KeyWrapAlgorithm; } }
            public string Dialect { get { return c_Dialect; } } 

            public Uri KeyTypeSymmetric { get { return m_KeyTypeSymmetric; } }
            public Uri KeyTypeAsymmetric { get { return m_KeyTypeAsymmetric; } }
            public Uri KeyTypeBearer { get { return m_KeyTypeBearer; } } 

            private static readonly Uri m_KeyTypeSymmetric = new Uri( Instance.Namespace + "/SymmetricKey" ); 
            private static readonly Uri m_KeyTypeAsymmetric = new Uri( Instance.Namespace + "/PublicKey" ); 
            private static readonly Uri m_KeyTypeBearer = new Uri( Instance.Namespace + "/Bearer" );
        } 

        internal sealed class WSTransfer
        {
            private WSTransfer() { } 

            public const string DefaultPrefix = "wxf"; 
            public const string Namespace = "http://schemas.xmlsoap.org/ws/2004/09/transfer"; 
            public const string Create = "Create";
            public const string CreateAction = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"; 
            public const string CreateResponseAction = "http://schemas.xmlsoap.org/ws/2004/09/transfer/CreateResponse";
            public const string Get = "Get";
            public const string GetAction = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Get";
            public const string GetResponseAction = "http://schemas.xmlsoap.org/ws/2004/09/transfer/GetResponse"; 
            public const string Put = "Put";
            public const string PutAction = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Put"; 
            public const string PutResponseAction = "http://schemas.xmlsoap.org/ws/2004/09/transfer/PutResponse"; 
            public const string Delete = "Delete";
            public const string DeleteAction = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete"; 
            public const string DeleteResponseAction = "http://schemas.xmlsoap.org/ws/2004/09/transfer/DeleteResponse";
            public const string ResourceCreated = "ResourceCreated";
            public const string WSTransferContractName = "WS-Transfer";
        } 

        public static XmlNamespaceManager CreateNamespaceManager( XmlNameTable nameTable ) 
        { 
            XmlNamespaceManager mgr = new XmlNamespaceManager( nameTable );
            mgr.AddNamespace( XmlNames.Saml11.DefaultPrefix, XmlNames.Saml11.Namespace ); 
            mgr.AddNamespace( XmlNames.Soap12.DefaultPrefix, XmlNames.Soap12.Namespace );
            mgr.AddNamespace( XmlNames.WSAddressing.DefaultPrefix, XmlNames.WSAddressing.Namespace );
            mgr.AddNamespace( XmlNames.WSIdentity.DefaultPrefix, XmlNames.WSIdentity.Namespace );
            mgr.AddNamespace( XmlNames.WSMetadataExchange.DefaultPrefix, XmlNames.WSMetadataExchange.Namespace ); 

            mgr.AddNamespace( XmlNames.WSPolicy.DefaultPrefix, XmlNames.WSPolicy.Namespace ); 
 
            mgr.AddNamespace( XmlNames.WSSecurityExt.DefaultPrefix, XmlNames.WSSecurityExt.Namespace );
            mgr.AddNamespace( XmlNames.WSSecurityUtility.DefaultPrefix, XmlNames.WSSecurityUtility.Namespace ); 
            mgr.AddNamespace( XmlNames.WSTransfer.DefaultPrefix, XmlNames.WSTransfer.Namespace );

            mgr.AddNamespace( XmlNames.WSTrust.DefaultPrefix, XmlNames.WSTrust.Namespace );
 
            mgr.AddNamespace( XmlNames.XmlDSig.DefaultPrefix, XmlNames.XmlDSig.Namespace );
            mgr.AddNamespace( XmlNames.XmlEnc.DefaultPrefix, XmlNames.XmlEnc.Namespace ); 
            mgr.AddNamespace( XmlNames.XmlSchema.DefaultPrefix, XmlNames.XmlSchema.Namespace ); 
            return mgr;
        } 

    }
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK