本文整理汇总了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();
}
示例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()));
}
示例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();
}