Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Base / MS / Internal / IO / Packaging / XmlStringTable.cs / 1 / XmlStringTable.cs
//------------------------------------------------------------------------------ // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // Static helper class that serves up Xml strings used to generate and parse // XmlDigitalSignatures. // // History: // 01/30/2005: [....]: Initial implementation. // //----------------------------------------------------------------------------- using System; using System.Xml; using System.Diagnostics; namespace MS.Internal.IO.Packaging { ////// Xml and string table /// ///See: http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/ for details internal static class XTable { ////// Get string given the ID /// /// string id ///string internal static String Get(ID i) { // catch mismatch in table editing Debug.Assert((int)ID._IllegalValue == _table.Length - 1, "ID enumeration should match TableEntry array - verify edits are matching"); Debug.Assert(i >= ID.OpcSignatureNamespace && i < ID._IllegalValue, "string index out of bounds"); Debug.Assert(i == _table[(int)i].id, "table enum out of order - verify order"); return _table[(int)i].s; } ////// One-to-One mapping from enum to string - this must be kept in sync with _table /// internal enum ID : int { OpcSignatureNamespace, OpcSignatureNamespacePrefix, OpcSignatureNamespaceAttribute, W3CSignatureNamespaceRoot, RelationshipsTransformName, //SignatureNamespacePrefix, SignatureTagName, OpcSignatureAttrValue, SignedInfoTagName, ReferenceTagName, // CanonicalizationMethodTagName, SignatureMethodTagName, ObjectTagName, KeyInfoTagName, ManifestTagName, TransformTagName, TransformsTagName, AlgorithmAttrName, SourceIdAttrName, OpcAttrValue, OpcLinkAttrValue, TargetAttrName, SignatureValueTagName, UriAttrName, DigestMethodTagName, DigestValueTagName, SignaturePropertiesTagName, SignaturePropertyTagName, SignatureTimeTagName, SignatureTimeFormatTagName, SignatureTimeValueTagName, RelationshipsTagName, RelationshipReferenceTagName, RelationshipsGroupReferenceTagName, SourceTypeAttrName, SignaturePropertyIdAttrName, SignaturePropertyIdAttrValue, // PackageRelationshipPartName, _IllegalValue // sentinel - not a legal value - equivalent to "not set" or "null" } //----------------------------------------------------------------------------- // private members //----------------------------------------------------------------------------- internal struct TableEntry { internal XTable.ID id; internal string s; internal TableEntry(XTable.ID index, string str) { id = index; s = str; } }; private static readonly TableEntry[] _table = new TableEntry[] { new TableEntry( ID.OpcSignatureNamespace, "http://schemas.openxmlformats.org/package/2006/digital-signature" ), new TableEntry( ID.OpcSignatureNamespacePrefix, "opc" ), new TableEntry( ID.OpcSignatureNamespaceAttribute, "xmlns:opc" ), new TableEntry( ID.W3CSignatureNamespaceRoot, "http://www.w3.org/2000/09/xmldsig#" ), new TableEntry( ID.RelationshipsTransformName, "http://schemas.openxmlformats.org/package/2006/RelationshipTransform" ), // new TableEntry( ID.SignatureNamespacePrefix, "ds" ), new TableEntry( ID.SignatureTagName, "Signature" ), new TableEntry( ID.OpcSignatureAttrValue, "SignatureIdValue" ), new TableEntry( ID.SignedInfoTagName, "SignedInfo" ), new TableEntry( ID.ReferenceTagName, "Reference" ), // new TableEntry( ID.CanonicalizationMethodTagName, "CanonicalizationMethod" ), new TableEntry( ID.SignatureMethodTagName, "SignatureMethod" ), new TableEntry( ID.ObjectTagName, "Object" ), new TableEntry( ID.KeyInfoTagName, "KeyInfo" ), new TableEntry( ID.ManifestTagName, "Manifest" ), new TableEntry( ID.TransformTagName, "Transform" ), new TableEntry( ID.TransformsTagName, "Transforms" ), new TableEntry( ID.AlgorithmAttrName, "Algorithm" ), new TableEntry( ID.SourceIdAttrName, "SourceId" ), new TableEntry( ID.OpcAttrValue, "idPackageObject" ), new TableEntry( ID.OpcLinkAttrValue, "#idPackageObject" ), new TableEntry( ID.TargetAttrName, "Target" ), new TableEntry( ID.SignatureValueTagName, "SignatureValue" ), new TableEntry( ID.UriAttrName, "URI" ), new TableEntry( ID.DigestMethodTagName, "DigestMethod" ), new TableEntry( ID.DigestValueTagName, "DigestValue" ), new TableEntry( ID.SignaturePropertiesTagName, "SignatureProperties" ), new TableEntry( ID.SignaturePropertyTagName, "SignatureProperty" ), new TableEntry( ID.SignatureTimeTagName, "SignatureTime" ), new TableEntry( ID.SignatureTimeFormatTagName, "Format" ), new TableEntry( ID.SignatureTimeValueTagName, "Value" ), new TableEntry( ID.RelationshipsTagName, "Relationships" ), new TableEntry( ID.RelationshipReferenceTagName, "RelationshipReference" ), new TableEntry( ID.RelationshipsGroupReferenceTagName, "RelationshipsGroupReference" ), new TableEntry( ID.SourceTypeAttrName, "SourceType" ), new TableEntry( ID.SignaturePropertyIdAttrName, "Id" ), new TableEntry( ID.SignaturePropertyIdAttrValue, "idSignatureTime" ), new TableEntry( ID._IllegalValue, "" ), }; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeLinePragma.cs
- AccessDataSource.cs
- SafeEventLogWriteHandle.cs
- XmlSignatureManifest.cs
- HeaderedContentControl.cs
- _Rfc2616CacheValidators.cs
- VScrollBar.cs
- ParameterElementCollection.cs
- BlurBitmapEffect.cs
- RoleManagerModule.cs
- InkCanvasSelection.cs
- CommandField.cs
- UrlMapping.cs
- VarRemapper.cs
- Light.cs
- NamedPipeConnectionPoolSettingsElement.cs
- LongValidatorAttribute.cs
- QueryTaskGroupState.cs
- StrokeNodeOperations2.cs
- XmlException.cs
- Point4D.cs
- AutomationEventArgs.cs
- DocumentScope.cs
- SystemResourceHost.cs
- Transform3DGroup.cs
- WeakHashtable.cs
- ConfigurationValidatorBase.cs
- PrtCap_Base.cs
- CheckBox.cs
- ObjectDataSourceStatusEventArgs.cs
- ColumnReorderedEventArgs.cs
- HostingEnvironmentSection.cs
- EraserBehavior.cs
- Rect3DConverter.cs
- WebPartDisplayModeEventArgs.cs
- MenuAdapter.cs
- SqlSupersetValidator.cs
- KeyInterop.cs
- CodeTypeMemberCollection.cs
- SerializationHelper.cs
- XsdCachingReader.cs
- ReadOnlyDataSource.cs
- UnsafeNativeMethods.cs
- CertificateManager.cs
- TypedAsyncResult.cs
- CryptoStream.cs
- TypeSemantics.cs
- XsdDateTime.cs
- NodeFunctions.cs
- SafeCertificateStore.cs
- TargetParameterCountException.cs
- RijndaelManagedTransform.cs
- RegexGroupCollection.cs
- XmlDictionaryReaderQuotas.cs
- CustomValidator.cs
- CompilerError.cs
- SqlAggregateChecker.cs
- WebResourceAttribute.cs
- StaticDataManager.cs
- StylusPointPropertyUnit.cs
- EndPoint.cs
- StreamingContext.cs
- XmlSchemaSimpleContentRestriction.cs
- TextSerializer.cs
- XmlSchemaIdentityConstraint.cs
- Guid.cs
- OLEDB_Enum.cs
- ContextDataSourceView.cs
- DrawingContextWalker.cs
- SupportingTokenAuthenticatorSpecification.cs
- MarkupExtensionParser.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- ExternalCalls.cs
- PropertyGroupDescription.cs
- ISFClipboardData.cs
- FixedSOMSemanticBox.cs
- DynamicActionMessageFilter.cs
- CqlBlock.cs
- WebPartConnectionsCancelVerb.cs
- SafeCryptoHandles.cs
- Int16Storage.cs
- SoapInteropTypes.cs
- Peer.cs
- UserPreferenceChangingEventArgs.cs
- WebConfigurationFileMap.cs
- AssemblyFilter.cs
- WeakEventTable.cs
- SqlCachedBuffer.cs
- ToolStripDesignerAvailabilityAttribute.cs
- dtdvalidator.cs
- IsolatedStorageFileStream.cs
- HtmlWindowCollection.cs
- AccessorTable.cs
- MenuItem.cs
- BaseTemplateBuildProvider.cs
- VisualTreeFlattener.cs
- DataColumnCollection.cs
- WizardForm.cs
- DateTimePickerDesigner.cs
- Vector.cs