• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Tokens.SecurityKeyIdentifierClause类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Matches

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

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


示例17: CanWriteKeyIdentifierClause

 public bool CanWriteKeyIdentifierClause(SecurityKeyIdentifierClause keyIdentifierClause)
 {
     if (keyIdentifierClause == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("keyIdentifierClause");
     }
     return this.CanWriteKeyIdentifierClauseCore(keyIdentifierClause);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:SecurityTokenSerializer.cs


示例18: Matches

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

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


示例19: Matches

		public override bool Matches (SecurityKeyIdentifierClause clause)
		{
			BinaryKeyIdentifierClause other =
				clause as BinaryKeyIdentifierClause;
			if (other == null)
				return false;
			return Matches (other.GetRawBuffer ());
		}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:BinaryKeyIdentifierClause.cs


示例20: Matches

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

            // 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.GetRawBuffer(), this.encryptionMethod, this.carriedKeyName));
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:EncryptedKeyIdentifierClause.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Tokens.SecurityToken类代码示例发布时间:2022-05-26
下一篇:
C# Tokens.SecurityKey类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap