当前位置: 首页>>代码示例>>C#>>正文


C# Tokens.SecurityKeyIdentifierClause类代码示例

本文整理汇总了C#中System.IdentityModel.Tokens.SecurityKeyIdentifierClause的典型用法代码示例。如果您正苦于以下问题:C# SecurityKeyIdentifierClause类的具体用法?C# SecurityKeyIdentifierClause怎么用?C# SecurityKeyIdentifierClause使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SecurityKeyIdentifierClause类属于System.IdentityModel.Tokens命名空间,在下文中一共展示了SecurityKeyIdentifierClause类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TryResolveSecurityKeyCore

        /// <summary>
        /// Inherited from <see cref="SecurityTokenResolver"/>.
        /// </summary>
        protected override bool TryResolveSecurityKeyCore( SecurityKeyIdentifierClause keyIdentifierClause, out SecurityKey key )
        {
            if ( keyIdentifierClause == null )
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull( "keyIdentifierClause" );
            }

            key = null;

            X509RawDataKeyIdentifierClause rawDataClause = keyIdentifierClause as X509RawDataKeyIdentifierClause;
            if ( rawDataClause != null )
            {
                key = rawDataClause.CreateKey();
                return true;
            }

            RsaKeyIdentifierClause rsaClause = keyIdentifierClause as RsaKeyIdentifierClause;
            if ( rsaClause != null )
            {
                key = rsaClause.CreateKey();
                return true;
            }

            if ( _wrappedTokenResolver.TryResolveSecurityKey( keyIdentifierClause, out key ) )
            {
                return true;
            }

            return false;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:33,代码来源:IssuerTokenResolver.cs

示例2: WriteKeyIdentifierClauseCore

 public override void WriteKeyIdentifierClauseCore(XmlDictionaryWriter writer, SecurityKeyIdentifierClause keyIdentifierClause)
 {
     EncryptedKeyIdentifierClause clause = keyIdentifierClause as EncryptedKeyIdentifierClause;
     writer.WriteStartElement(XD.XmlEncryptionDictionary.Prefix.Value, XD.XmlEncryptionDictionary.EncryptedKey, this.NamespaceUri);
     if (clause.EncryptionMethod != null)
     {
         writer.WriteStartElement(XD.XmlEncryptionDictionary.Prefix.Value, XD.XmlEncryptionDictionary.EncryptionMethod, this.NamespaceUri);
         writer.WriteAttributeString(XD.XmlEncryptionDictionary.AlgorithmAttribute, null, clause.EncryptionMethod);
         if (clause.EncryptionMethod == XD.SecurityAlgorithmDictionary.RsaOaepKeyWrap.Value)
         {
             writer.WriteStartElement("", XD.XmlSignatureDictionary.DigestMethod, XD.XmlSignatureDictionary.Namespace);
             writer.WriteAttributeString(XD.XmlSignatureDictionary.Algorithm, null, "http://www.w3.org/2000/09/xmldsig#sha1");
             writer.WriteEndElement();
         }
         writer.WriteEndElement();
     }
     if (clause.EncryptingKeyIdentifier != null)
     {
         this.tokenSerializer.WriteKeyIdentifier(writer, clause.EncryptingKeyIdentifier);
     }
     writer.WriteStartElement(XD.XmlEncryptionDictionary.Prefix.Value, XD.XmlEncryptionDictionary.CipherData, this.NamespaceUri);
     writer.WriteStartElement(XD.XmlEncryptionDictionary.Prefix.Value, XD.XmlEncryptionDictionary.CipherValue, this.NamespaceUri);
     byte[] encryptedKey = clause.GetEncryptedKey();
     writer.WriteBase64(encryptedKey, 0, encryptedKey.Length);
     writer.WriteEndElement();
     writer.WriteEndElement();
     if (clause.CarriedKeyName != null)
     {
         writer.WriteElementString(XD.XmlEncryptionDictionary.Prefix.Value, XD.XmlEncryptionDictionary.CarriedKeyName, this.NamespaceUri, clause.CarriedKeyName);
     }
     writer.WriteEndElement();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:32,代码来源:XmlEncApr2001.cs

示例3: DerivedKeySecurityToken

 internal DerivedKeySecurityToken(int generation, int offset, int length, string label, byte[] nonce, SecurityToken tokenToDerive, SecurityKeyIdentifierClause tokenToDeriveIdentifier, string derivationAlgorithm, string id)
 {
     this.length = -1;
     this.offset = -1;
     this.generation = -1;
     this.Initialize(id, generation, offset, length, label, nonce, tokenToDerive, tokenToDeriveIdentifier, derivationAlgorithm, false);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:DerivedKeySecurityToken.cs

示例4: Matches

		public override bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
		{
			InternalEncryptedKeyIdentifierClause kic = keyIdentifierClause as InternalEncryptedKeyIdentifierClause;
			if (kic == null)
				return false;
			return Matches (kic.GetRawBuffer ());
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:InternalEncryptedKeyIdentifierClause.cs

示例5: Matches

		public override bool Matches (
			SecurityKeyIdentifierClause keyIdentifierClause)
		{
			SecurityContextKeyIdentifierClause other =
				keyIdentifierClause as SecurityContextKeyIdentifierClause;
			return  other != null && Matches (other.context, other.generation);
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:SecurityContextKeyIdentifierClause.cs

示例6: DerivedKeySecurityToken

		public DerivedKeySecurityToken (string id, string algorithm,
			SecurityKeyIdentifierClause reference,
			SymmetricSecurityKey referencedKey,
			string name,
			int? generation,
			int? offset,
			int? length,
			string label,
			byte [] nonce)
		{
			algorithm = algorithm ?? SecurityAlgorithms.Psha1KeyDerivation;

			this.id = id;
			this.algorithm = algorithm;
			this.reference = reference;
			this.generation = generation;
			this.offset = offset;
			this.length = length;
			this.nonce = nonce;
			this.name = name;
			this.label = label;

			SecurityKey key = new InMemorySymmetricSecurityKey (
				referencedKey.GenerateDerivedKey (
					algorithm,
					Encoding.UTF8.GetBytes (label ?? Constants.WsscDefaultLabel),
					nonce,
					(length ?? 32) * 8,
					offset ?? 0));
			keys = new ReadOnlyCollection<SecurityKey> (
				new SecurityKey [] {key});
		}
开发者ID:nickchal,项目名称:pash,代码行数:32,代码来源:DerivedKeySecurityToken.cs

示例7: Matches

        public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause)
        {
            SamlAssertionDirectKeyIdentifierClause that = keyIdentifierClause as SamlAssertionDirectKeyIdentifierClause;

            // PreSharp Bug: Parameter 'that' to this public method must be validated: A null-dereference can occur here.
#pragma warning suppress 56506
            return (ReferenceEquals(this, that) || (that != null && that.SamlUri == this.SamlUri));
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:SamlAssertionDirectKeyIdentifierClause.cs

示例8: Matches

        public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause)
        {
            BinaryKeyIdentifierClause that = keyIdentifierClause as BinaryKeyIdentifierClause;

            // PreSharp 
            #pragma warning suppress 56506
            return ReferenceEquals(this, that) || (that != null && that.Matches(this.identificationData));
        }
开发者ID:uQr,项目名称:referencesource,代码行数:8,代码来源:BinaryKeyIdentifierClause.cs

示例9: Matches

		public override bool Matches (SecurityKeyIdentifierClause clause)
		{
			if (clause == null)
				throw new ArgumentNullException ("clause");
			KeyNameIdentifierClause knic =
				clause as KeyNameIdentifierClause;
			return knic != null && Matches (knic.KeyName);
		}
开发者ID:nickchal,项目名称:pash,代码行数:8,代码来源:KeyNameIdentifierClause.cs

示例10: Matches

        public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause)
        {
            RsaKeyIdentifierClause that = keyIdentifierClause as RsaKeyIdentifierClause;

            // PreSharp Bug: Parameter 'that' to this public method must be validated: A null-dereference can occur here.
            #pragma warning suppress 56506
            return ReferenceEquals(this, that) || (that != null && that.Matches(this.rsa));
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:8,代码来源:RsaKeyIdentifierClause.cs

示例11: Matches

		public override bool Matches (SecurityKeyIdentifierClause clause)
		{
			if (clause == null)
				throw new ArgumentNullException ("clause");
			LocalIdKeyIdentifierClause c =
				clause as LocalIdKeyIdentifierClause;
			return c != null && Matches (c.LocalId, c.OwnerType);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:LocalIdKeyIdentifierClause.cs

示例12: Matches

        public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause)
        {
            GenericXmlSecurityKeyIdentifierClause that = keyIdentifierClause as GenericXmlSecurityKeyIdentifierClause;

            // PreSharp 
#pragma warning suppress 56506
            return ReferenceEquals(this, that) || (that != null && that.Matches(this.ReferenceXml));
        }
开发者ID:uQr,项目名称:referencesource,代码行数:8,代码来源:GenericXmlSecurityKeyIdentifierClause.cs

示例13: Matches

        public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause)
        {
            LocalIdKeyIdentifierClause that = keyIdentifierClause as LocalIdKeyIdentifierClause;

            // PreSharp 
#pragma warning suppress 56506
            return ReferenceEquals(this, that) || (that != null && that.Matches(this.localId, this.OwnerType));
        }
开发者ID:uQr,项目名称:referencesource,代码行数:8,代码来源:LocalIdKeyIdentifierClause.cs

示例14: Matches

		public override bool Matches (SecurityKeyIdentifierClause clause)
		{
			if (clause == null)
				throw new ArgumentNullException ("clause");
			RsaKeyIdentifierClause rkic =
				clause as RsaKeyIdentifierClause;
			return rkic != null && Matches (rkic.Rsa);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:RsaKeyIdentifierClause.cs

示例15: GetKeyIdentifierClauseXml

		public static string GetKeyIdentifierClauseXml (SecurityTokenSerializer serializer, XmlWriterSettings settings, SecurityKeyIdentifierClause item)
		{
			StringWriter sw = new StringWriter ();
			using (XmlWriter xw = XmlWriter.Create (sw)) {
				serializer.WriteKeyIdentifierClause (xw, item);
			}
			return sw.ToString ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:NativeGenericXmlToken.cs


注:本文中的System.IdentityModel.Tokens.SecurityKeyIdentifierClause类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。