public override bool MatchesKeyIdentifierClause(SecurityKeyIdentifierClause keyIdentifierClause)
        {
            if (InternalTokenReference != null && InternalTokenReference.Matches(keyIdentifierClause))
            {
                return(true);
            }
            else if (ExternalTokenReference != null && ExternalTokenReference.Matches(keyIdentifierClause))
            {
                return(true);
            }

            return(false);
        }
        public override T CreateKeyIdentifierClause <T>()
        {
            if (InternalTokenReference != null && typeof(T) == InternalTokenReference.GetType())
            {
                return((T)InternalTokenReference);
            }

            if (ExternalTokenReference != null && typeof(T) == ExternalTokenReference.GetType())
            {
                return((T)ExternalTokenReference);
            }

            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(SR.Format(SR.UnableToCreateTokenReference)));
        }
        public override bool CanCreateKeyIdentifierClause <T>()
        {
            if (InternalTokenReference != null && typeof(T) == InternalTokenReference.GetType())
            {
                return(true);
            }

            if (ExternalTokenReference != null && typeof(T) == ExternalTokenReference.GetType())
            {
                return(true);
            }

            return(false);
        }