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


C# SecurityKeyIdentifier.GetType方法代码示例

本文整理汇总了C#中SecurityKeyIdentifier.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# SecurityKeyIdentifier.GetType方法的具体用法?C# SecurityKeyIdentifier.GetType怎么用?C# SecurityKeyIdentifier.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SecurityKeyIdentifier的用法示例。


在下文中一共展示了SecurityKeyIdentifier.GetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteKeyIdentifierCore

 protected override void WriteKeyIdentifierCore(XmlWriter writer, SecurityKeyIdentifier keyIdentifier)
 {
     bool flag = false;
     XmlDictionaryWriter writer2 = XmlDictionaryWriter.CreateDictionaryWriter(writer);
     for (int i = 0; i < this.keyIdentifierEntries.Count; i++)
     {
         KeyIdentifierEntry entry = this.keyIdentifierEntries[i];
         if (entry.SupportsCore(keyIdentifier))
         {
             try
             {
                 entry.WriteKeyIdentifierCore(writer2, keyIdentifier);
             }
             catch (Exception exception)
             {
                 if (!this.ShouldWrapException(exception))
                 {
                     throw;
                 }
                 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(System.ServiceModel.SR.GetString("ErrorSerializingKeyIdentifier"), exception));
             }
             flag = true;
             break;
         }
     }
     if (!flag)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("StandardsManagerCannotWriteObject", new object[] { keyIdentifier.GetType() })));
     }
     writer2.Flush();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:31,代码来源:WSSecurityTokenSerializer.cs

示例2: WriteSubjectKeyInfo

        /// <summary>
        /// Write the SamlSubject SecurityKeyIdentifier to the XmlWriter.
        /// </summary>
        /// <param name="writer">XmlWriter to write the SecurityKeyIdentifier.</param>
        /// <param name="subjectSki">SecurityKeyIdentifier to serialize.</param>
        /// <exception cref="ArgumentNullException">The inpur parameter 'writer' or 'subjectSki' is null.</exception>
        protected virtual void WriteSubjectKeyInfo(XmlWriter writer, SecurityKeyIdentifier subjectSki)
        {
            if (writer == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("writer");
            }

            if (subjectSki == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("subjectSki");
            }

            if (KeyInfoSerializer.CanWriteKeyIdentifier(subjectSki))
            {
                KeyInfoSerializer.WriteKeyIdentifier(writer, subjectSki);
                return;
            }

            throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("subjectSki", SR.GetString(SR.ID4091, subjectSki.GetType()));
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:26,代码来源:SamlSecurityTokenHandler.cs

示例3: WriteKeyIdentifierCore

        protected override void WriteKeyIdentifierCore(XmlWriter writer, SecurityKeyIdentifier keyIdentifier)
        {
            bool wroteKeyIdentifier = false;
            XmlDictionaryWriter localWriter = XmlDictionaryWriter.CreateDictionaryWriter(writer);
            for (int i = 0; i < this.keyIdentifierEntries.Count; ++i)
            {
                KeyIdentifierEntry keyIdentifierEntry = this.keyIdentifierEntries[i];
                if (keyIdentifierEntry.SupportsCore(keyIdentifier))
                {
                    try
                    {
                        keyIdentifierEntry.WriteKeyIdentifierCore(localWriter, keyIdentifier);
                    }
#pragma warning suppress 56500 // covered by FxCOP
                    catch (Exception e)
                    {
                        if (Fx.IsFatal(e))
                            throw;
                        
                        if (!ShouldWrapException(e))
                        {
                            throw;
                        }

                        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ErrorSerializingKeyIdentifier), e));
                    }
                    wroteKeyIdentifier = true;
                    break;
                }
            }

            if (!wroteKeyIdentifier)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.StandardsManagerCannotWriteObject, keyIdentifier.GetType())));

            localWriter.Flush();
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:36,代码来源:KeyInfoSerializer.cs


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