コード例 #1
0
        private bool CanPromoteToRoot(XmlElement innerElement, WSTrustDec2005.DriverDec2005 trust13Driver, bool clientSideClaimTypeRequirementsSpecified)
        {
            SecurityKeyType         dummyOutParamForKeyType;
            int                     dummyOutParamForKeySize;
            string                  dummyStringOutParam;
            Collection <XmlElement> dummyOutParamForRequiredClaims = null;

            // check if SecondaryParameters has claim requirements specified
            if (trust13Driver.TryParseRequiredClaimsElement(innerElement, out dummyOutParamForRequiredClaims))
            {
                // if client has not specified any claim requirements, promote claim requirements
                // in SecondaryParameters to root level (and subsequently fix up the trust namespace)
                return(!clientSideClaimTypeRequirementsSpecified);
            }

            // KeySize, KeyType and TokenType were converted to top-level property values when the WSDL was
            // imported, so drop it here. We check for EncryptWith and SignWith as these are Client specific algorithm values and we
            // don't have to promote the service specified values. KeyWrapAlgorithm was never sent in the RST
            // in V1 and hence we are dropping it here as well.
            return(!trust13Driver.TryParseKeyTypeElement(innerElement, out dummyOutParamForKeyType) &&
                   !trust13Driver.TryParseKeySizeElement(innerElement, out dummyOutParamForKeySize) &&
                   !trust13Driver.TryParseTokenTypeElement(innerElement, out dummyStringOutParam) &&
                   !trust13Driver.IsSignWithElement(innerElement, out dummyStringOutParam) &&
                   !trust13Driver.IsEncryptWithElement(innerElement, out dummyStringOutParam) &&
                   !trust13Driver.IsKeyWrapAlgorithmElement(innerElement, out dummyStringOutParam));
        }
コード例 #2
0
        private bool CanPromoteToRoot(XmlElement innerElement, WSTrustDec2005.DriverDec2005 trust13Driver, bool clientSideClaimTypeRequirementsSpecified)
        {
            Collection <XmlElement> requiredClaims = (Collection <XmlElement>)null;

            if (trust13Driver.TryParseRequiredClaimsElement(innerElement, out requiredClaims))
            {
                return(!clientSideClaimTypeRequirementsSpecified);
            }
            SecurityKeyType keyType;
            int             keySize;
            string          str;

            if (!trust13Driver.TryParseKeyTypeElement(innerElement, out keyType) && !trust13Driver.TryParseKeySizeElement(innerElement, out keySize) && (!trust13Driver.TryParseTokenTypeElement(innerElement, out str) && !trust13Driver.IsSignWithElement(innerElement, out str)) && !trust13Driver.IsEncryptWithElement(innerElement, out str))
            {
                return(!trust13Driver.IsKeyWrapAlgorithmElement(innerElement, out str));
            }
            return(false);
        }