本文整理汇总了C#中System.IdentityModel.DictionaryManager类的典型用法代码示例。如果您正苦于以下问题:C# DictionaryManager类的具体用法?C# DictionaryManager怎么用?C# DictionaryManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DictionaryManager类属于System.IdentityModel命名空间,在下文中一共展示了DictionaryManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: PopulateDictionary
// Interface to plug in external Dictionaries. The external
// dictionary should already be populated with all strings
// required by this assembly.
public void PopulateDictionary(IXmlDictionary dictionary)
{
if (dictionary == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("dictionary");
this.dictionaryManager = new DictionaryManager(dictionary);
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:10,代码来源:SamlSerializer.cs
示例2: Process
public override object Process(object input, SignatureResourcePool resourcePool, DictionaryManager dictionaryManager)
{
XmlTokenStream tokenStream = input as XmlTokenStream;
if (tokenStream != null)
{
tokenStream.SetElementExclusion(XmlSignatureStrings.Signature, XmlSignatureStrings.Namespace);
return tokenStream;
}
WrappedReader reader = input as WrappedReader;
if ( reader != null )
{
// The Enveloped Signature Transform is supposed to remove the
// Signature which encloses the transform element. Previous versions
// of this code stripped out all Signature elements at any depth,
// which did not allow nested signed structures. By specifying '1'
// as the depth, we narrow our range of support so that we require
// that the enveloped signature be a direct child of the element
// being signed.
reader.XmlTokens.SetElementExclusion( XmlSignatureConstants.Elements.Signature, XmlSignatureConstants.Namespace, 1 );
return reader;
}
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.UnsupportedInputTypeForTransform, input.GetType())));
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:25,代码来源:EnvelopedSignatureTransform.cs
示例3: KeyInfoSerializer
public KeyInfoSerializer(
bool emitBspRequiredAttributes,
DictionaryManager dictionaryManager,
TrustDictionary trustDictionary,
SecurityTokenSerializer innerSecurityTokenSerializer ) :
this( emitBspRequiredAttributes, dictionaryManager, trustDictionary, innerSecurityTokenSerializer, null )
{
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:KeyInfoSerializer.cs
示例4: ReadFrom
public override void ReadFrom(XmlDictionaryReader reader, DictionaryManager dictionaryManager)
{
reader.MoveToContent();
if (XmlHelper.ReadEmptyElementAndRequiredAttribute(reader, dictionaryManager.XmlSignatureDictionary.Transform, dictionaryManager.XmlSignatureDictionary.Namespace, dictionaryManager.XmlSignatureDictionary.Algorithm, out this.prefix) != this.Algorithm)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CryptographicException(System.IdentityModel.SR.GetString("AlgorithmMismatchForTransform")));
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:EnvelopedSignatureTransform.cs
示例5: TransformToDigest
public byte[] TransformToDigest(object data, SignatureResourcePool resourcePool, string digestMethod, DictionaryManager dictionaryManager)
{
for (int i = 0; i < (this.TransformCount - 1); i++)
{
data = this[i].Process(data, resourcePool, dictionaryManager);
}
return this[this.TransformCount - 1].ProcessAndDigest(data, resourcePool, digestMethod, dictionaryManager);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:TransformChain.cs
示例6: WriteTo
public void WriteTo(XmlDictionaryWriter writer, DictionaryManager dictionaryManager)
{
writer.WriteStartElement(this.prefix, dictionaryManager.XmlSignatureDictionary.Transforms, dictionaryManager.XmlSignatureDictionary.Namespace);
for (int i = 0; i < this.TransformCount; i++)
{
this[i].WriteTo(writer, dictionaryManager);
}
writer.WriteEndElement();
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:TransformChain.cs
示例7: PreDigestedSignedInfo
public PreDigestedSignedInfo(DictionaryManager dictionaryManager, string canonicalizationMethod, XmlDictionaryString canonicalizationMethodDictionaryString, string digestMethod, XmlDictionaryString digestMethodDictionaryString, string signatureMethod, XmlDictionaryString signatureMethodDictionaryString) : base(dictionaryManager)
{
this.references = new ReferenceEntry[8];
base.CanonicalizationMethod = canonicalizationMethod;
base.CanonicalizationMethodDictionaryString = canonicalizationMethodDictionaryString;
this.DigestMethod = digestMethod;
this.digestMethodDictionaryString = digestMethodDictionaryString;
base.SignatureMethod = signatureMethod;
base.SignatureMethodDictionaryString = signatureMethodDictionaryString;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:PreDigestedSignedInfo.cs
示例8: Process
public override object Process(object input, SignatureResourcePool resourcePool, DictionaryManager dictionaryManager)
{
XmlTokenStream stream = input as XmlTokenStream;
if (stream == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(System.IdentityModel.SR.GetString("UnsupportedInputTypeForTransform", new object[] { input.GetType() })));
}
stream.SetElementExclusion("Signature", "http://www.w3.org/2000/09/xmldsig#");
return stream;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:EnvelopedSignatureTransform.cs
示例9: WriteTo
public override void WriteTo(XmlDictionaryWriter writer, DictionaryManager dictionaryManager)
{
string prefix = "";
XmlDictionaryString namespaceUri = dictionaryManager.XmlSignatureDictionary.Namespace;
writer.WriteStartElement(prefix, dictionaryManager.XmlSignatureDictionary.SignedInfo, namespaceUri);
if (base.Id != null)
{
writer.WriteAttributeString(dictionaryManager.UtilityDictionary.IdAttribute, null, base.Id);
}
base.WriteCanonicalizationMethod(writer, dictionaryManager);
base.WriteSignatureMethod(writer, dictionaryManager);
for (int i = 0; i < this.count; i++)
{
writer.WriteStartElement(prefix, dictionaryManager.XmlSignatureDictionary.Reference, namespaceUri);
writer.WriteStartAttribute(dictionaryManager.XmlSignatureDictionary.URI, null);
writer.WriteString("#");
writer.WriteString(this.references[i].id);
writer.WriteEndAttribute();
writer.WriteStartElement(prefix, dictionaryManager.XmlSignatureDictionary.Transforms, namespaceUri);
if (this.addEnvelopedSignatureTransform)
{
writer.WriteStartElement(prefix, dictionaryManager.XmlSignatureDictionary.Transform, namespaceUri);
writer.WriteStartAttribute(dictionaryManager.XmlSignatureDictionary.Algorithm, null);
writer.WriteString(dictionaryManager.XmlSignatureDictionary.EnvelopedSignature);
writer.WriteEndAttribute();
writer.WriteEndElement();
}
writer.WriteStartElement(prefix, dictionaryManager.XmlSignatureDictionary.Transform, namespaceUri);
writer.WriteStartAttribute(dictionaryManager.XmlSignatureDictionary.Algorithm, null);
writer.WriteString(dictionaryManager.SecurityAlgorithmDictionary.ExclusiveC14n);
writer.WriteEndAttribute();
writer.WriteEndElement();
writer.WriteEndElement();
writer.WriteStartElement(prefix, dictionaryManager.XmlSignatureDictionary.DigestMethod, namespaceUri);
writer.WriteStartAttribute(dictionaryManager.XmlSignatureDictionary.Algorithm, null);
if (this.digestMethodDictionaryString != null)
{
writer.WriteString(this.digestMethodDictionaryString);
}
else
{
writer.WriteString(this.digestMethod);
}
writer.WriteEndAttribute();
writer.WriteEndElement();
byte[] digest = this.references[i].digest;
writer.WriteStartElement(prefix, dictionaryManager.XmlSignatureDictionary.DigestValue, namespaceUri);
writer.WriteBase64(digest, 0, digest.Length);
writer.WriteEndElement();
writer.WriteEndElement();
}
writer.WriteEndElement();
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:53,代码来源:PreDigestedSignedInfo.cs
示例10: EnvelopedSignatureWriter
/// <summary>
/// Initializes an instance of <see cref="EnvelopedSignatureWriter"/>. The returned writer can be directly used
/// to write the envelope. The signature will be automatically generated when
/// the envelope is completed.
/// </summary>
/// <param name="innerWriter">Writer to wrap/</param>
/// <param name="signingCredentials">SigningCredentials to be used to generate the signature.</param>
/// <param name="referenceId">The reference Id of the envelope.</param>
/// <param name="securityTokenSerializer">SecurityTokenSerializer to serialize the signature KeyInfo.</param>
/// <exception cref="ArgumentNullException">One of he input parameter is null.</exception>
/// <exception cref="ArgumentException">The string 'referenceId' is either null or empty.</exception>
public EnvelopedSignatureWriter(XmlWriter innerWriter, SigningCredentials signingCredentials, string referenceId, SecurityTokenSerializer securityTokenSerializer)
{
if (innerWriter == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("innerWriter");
}
if (signingCredentials == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("signingCredentials");
}
if (string.IsNullOrEmpty(referenceId))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(SR.GetString(SR.ID0006), "referenceId"));
}
if (securityTokenSerializer == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("securityTokenSerializer");
}
// Remember the user's writer here. We need to finally write out the signed XML
// into this writer.
_dictionaryManager = new DictionaryManager();
_innerWriter = innerWriter;
_signingCreds = signingCredentials;
_referenceId = referenceId;
_tokenSerializer = securityTokenSerializer;
_signatureFragment = new MemoryStream();
_endFragment = new MemoryStream();
_writerStream = new MemoryStream();
XmlDictionaryWriter effectiveWriter = XmlDictionaryWriter.CreateTextWriter(_writerStream, Encoding.UTF8, false);
// Initialize the base writer to the newly created writer. The user should write the XML
// to this.
base.InitializeInnerWriter(effectiveWriter);
_hashAlgorithm = CryptoHelper.CreateHashAlgorithm(_signingCreds.DigestAlgorithm);
_hashStream = new HashStream(_hashAlgorithm);
base.InnerWriter.StartCanonicalization(_hashStream, false, null);
//
// Add tracing for the un-canonicalized bytes
//
if (DiagnosticUtility.ShouldTraceVerbose)
{
_preCanonicalTracingStream = new MemoryStream();
base.InitializeTracingWriter(new XmlTextWriter(_preCanonicalTracingStream, Encoding.UTF8));
}
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:63,代码来源:EnvelopedSignatureWriter.cs
示例11: WriteTo
public void WriteTo(XmlDictionaryWriter writer, DictionaryManager dictionaryManager)
{
if (this.DataReferenceCount == 0)
{
throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("ReferenceListCannotBeEmpty")));
}
writer.WriteStartElement("e", ElementName, NamespaceUri);
for (int i = 0; i < this.DataReferenceCount; i++)
{
DataReference.WriteTo(writer, this.referredIds[i]);
}
writer.WriteEndElement();
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:ReferenceList.cs
示例12: Reference
public Reference(DictionaryManager dictionaryManager, string uri, object resolvedXmlSource)
{
this.digestValueElement = new DigestValueElement();
this.prefix = "";
this.transformChain = new System.IdentityModel.TransformChain();
if (dictionaryManager == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("dictionaryManager");
}
this.dictionaryManager = dictionaryManager;
this.digestMethodElement = new ElementWithAlgorithmAttribute(dictionaryManager.XmlSignatureDictionary.DigestMethod);
this.uri = uri;
this.resolvedXmlSource = resolvedXmlSource;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:Reference.cs
示例13: ReadFrom
public void ReadFrom(XmlDictionaryReader reader, DictionaryManager dictionaryManager)
{
reader.MoveToStartElement(dictionaryManager.XmlSignatureDictionary.Signature, dictionaryManager.XmlSignatureDictionary.Namespace);
this.prefix = reader.Prefix;
this.Id = reader.GetAttribute(dictionaryManager.UtilityDictionary.IdAttribute, null);
reader.Read();
this.signedInfo.ReadFrom(reader, this.signedXml.TransformFactory, dictionaryManager);
this.signatureValueElement.ReadFrom(reader, dictionaryManager);
if (this.signedXml.SecurityTokenSerializer.CanReadKeyIdentifier(reader))
{
this.keyIdentifier = this.signedXml.SecurityTokenSerializer.ReadKeyIdentifier(reader);
}
reader.ReadEndElement();
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:Signature.cs
示例14: WriteTo
public void WriteTo(XmlDictionaryWriter writer, DictionaryManager dictionaryManager)
{
writer.WriteStartElement(this.prefix, dictionaryManager.XmlSignatureDictionary.Signature, dictionaryManager.XmlSignatureDictionary.Namespace);
if (this.id != null)
{
writer.WriteAttributeString(dictionaryManager.UtilityDictionary.IdAttribute, null, this.id);
}
this.signedInfo.WriteTo(writer, dictionaryManager);
this.signatureValueElement.WriteTo(writer, dictionaryManager);
if (this.keyIdentifier != null)
{
this.signedXml.SecurityTokenSerializer.WriteKeyIdentifier(writer, this.keyIdentifier);
}
writer.WriteEndElement();
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:Signature.cs
示例15: WriteTo
public void WriteTo(XmlDictionaryWriter writer, DictionaryManager dictionaryManager)
{
writer.WriteStartElement(this.prefix, this.elementName, dictionaryManager.XmlSignatureDictionary.Namespace);
writer.WriteStartAttribute(dictionaryManager.XmlSignatureDictionary.Algorithm, null);
if (this.algorithmDictionaryString != null)
{
writer.WriteString(this.algorithmDictionaryString);
}
else
{
writer.WriteString(this.algorithm);
}
writer.WriteEndAttribute();
writer.WriteEndElement();
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:ElementWithAlgorithmAttribute.cs
示例16: ReadFrom
public void ReadFrom(XmlDictionaryReader reader, DictionaryManager dictionaryManager)
{
reader.MoveToStartElement(this.elementName, dictionaryManager.XmlSignatureDictionary.Namespace);
this.prefix = reader.Prefix;
bool isEmptyElement = reader.IsEmptyElement;
this.algorithm = reader.GetAttribute(dictionaryManager.XmlSignatureDictionary.Algorithm, null);
if (this.algorithm == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CryptographicException(System.IdentityModel.SR.GetString("RequiredAttributeMissing", new object[] { dictionaryManager.XmlSignatureDictionary.Algorithm, this.elementName })));
}
reader.Read();
reader.MoveToContent();
if (!isEmptyElement)
{
reader.MoveToContent();
reader.ReadEndElement();
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:18,代码来源:ElementWithAlgorithmAttribute.cs
示例17: SignedXml
internal SignedXml(SignedInfo signedInfo, DictionaryManager dictionaryManager, SecurityTokenSerializer tokenSerializer)
{
if (signedInfo == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("signedInfo"));
}
if (dictionaryManager == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("dictionaryManager");
}
if (tokenSerializer == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("tokenSerializer");
}
this.transformFactory = StandardTransformFactory.Instance;
this.tokenSerializer = tokenSerializer;
this.signature = new Signature(this, signedInfo);
this.dictionaryManager = dictionaryManager;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:19,代码来源:SignedXml.cs
示例18: ReadFrom
public void ReadFrom(XmlDictionaryReader reader, TransformFactory transformFactory, DictionaryManager dictionaryManager)
{
reader.MoveToStartElement(dictionaryManager.XmlSignatureDictionary.Transforms, dictionaryManager.XmlSignatureDictionary.Namespace);
this.prefix = reader.Prefix;
reader.Read();
while (reader.IsStartElement(dictionaryManager.XmlSignatureDictionary.Transform, dictionaryManager.XmlSignatureDictionary.Namespace))
{
string attribute = reader.GetAttribute(dictionaryManager.XmlSignatureDictionary.Algorithm, null);
Transform transform = transformFactory.CreateTransform(attribute);
transform.ReadFrom(reader, dictionaryManager);
this.Add(transform);
}
reader.MoveToContent();
reader.ReadEndElement();
if (this.TransformCount == 0)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CryptographicException(System.IdentityModel.SR.GetString("AtLeastOneTransformRequired")));
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:19,代码来源:TransformChain.cs
示例19: Process
public override object Process(object input, SignatureResourcePool resourcePool, DictionaryManager dictionaryManager)
{
if (input is XmlReader)
{
CanonicalizationDriver configuredDriver = this.GetConfiguredDriver(resourcePool);
configuredDriver.SetInput(input as XmlReader);
return configuredDriver.GetMemoryStream();
}
if (!(input is ISecurityElement))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(System.IdentityModel.SR.GetString("UnsupportedInputTypeForTransform", new object[] { input.GetType() })));
}
MemoryStream stream = new MemoryStream();
XmlDictionaryWriter writer = resourcePool.TakeUtf8Writer();
writer.StartCanonicalization(stream, false, null);
(input as ISecurityElement).WriteTo(writer, dictionaryManager);
writer.EndCanonicalization();
stream.Seek(0L, SeekOrigin.Begin);
return stream;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:20,代码来源:ExclusiveCanonicalizationTransform.cs
示例20: ProcessAndDigest
public void ProcessAndDigest(object input, SignatureResourcePool resourcePool, HashAlgorithm hash, DictionaryManager dictionaryManger)
{
HashStream hashStream = resourcePool.TakeHashStream(hash);
XmlReader reader = input as XmlReader;
if (reader != null)
{
this.ProcessReaderInput(reader, resourcePool, hashStream);
}
else
{
if (!(input is ISecurityElement))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(System.IdentityModel.SR.GetString("UnsupportedInputTypeForTransform", new object[] { input.GetType() })));
}
XmlDictionaryWriter writer = resourcePool.TakeUtf8Writer();
writer.StartCanonicalization(hashStream, this.IncludeComments, this.GetInclusivePrefixes());
(input as ISecurityElement).WriteTo(writer, dictionaryManger);
writer.EndCanonicalization();
}
hashStream.FlushHash();
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:21,代码来源:ExclusiveCanonicalizationTransform.cs
注:本文中的System.IdentityModel.DictionaryManager类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论