Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / Security / Cryptography / SignatureDescription.cs / 1 / SignatureDescription.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // SignatureDescription.cs // namespace System.Security.Cryptography { using System.Security.Util; [System.Runtime.InteropServices.ComVisible(true)] public class SignatureDescription { private String _strKey; private String _strDigest; private String _strFormatter; private String _strDeformatter; // // public constructors // public SignatureDescription() { } public SignatureDescription(SecurityElement el) { if (el == null) throw new ArgumentNullException("el"); _strKey = el.SearchForTextOfTag("Key"); _strDigest = el.SearchForTextOfTag("Digest"); _strFormatter = el.SearchForTextOfTag("Formatter"); _strDeformatter = el.SearchForTextOfTag("Deformatter"); } // // property methods // public String KeyAlgorithm { get { return _strKey; } set { _strKey = value; } } public String DigestAlgorithm { get { return _strDigest; } set { _strDigest = value; } } public String FormatterAlgorithm { get { return _strFormatter; } set { _strFormatter = value; } } public String DeformatterAlgorithm { get {return _strDeformatter; } set {_strDeformatter = value; } } // // public methods // public virtual AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key) { AsymmetricSignatureDeformatter item; item = (AsymmetricSignatureDeformatter) CryptoConfig.CreateFromName(_strDeformatter); item.SetKey(key); return item; } public virtual AsymmetricSignatureFormatter CreateFormatter(AsymmetricAlgorithm key) { AsymmetricSignatureFormatter item; item = (AsymmetricSignatureFormatter) CryptoConfig.CreateFromName(_strFormatter); item.SetKey(key); return item; } public virtual HashAlgorithm CreateDigest() { return (HashAlgorithm) CryptoConfig.CreateFromName(_strDigest); } } internal class RSAPKCS1SHA1SignatureDescription : SignatureDescription { public RSAPKCS1SHA1SignatureDescription() { KeyAlgorithm = "System.Security.Cryptography.RSACryptoServiceProvider"; DigestAlgorithm = "System.Security.Cryptography.SHA1CryptoServiceProvider"; FormatterAlgorithm = "System.Security.Cryptography.RSAPKCS1SignatureFormatter"; DeformatterAlgorithm = "System.Security.Cryptography.RSAPKCS1SignatureDeformatter"; } public override AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key) { AsymmetricSignatureDeformatter item = (AsymmetricSignatureDeformatter) CryptoConfig.CreateFromName(DeformatterAlgorithm); item.SetKey(key); item.SetHashAlgorithm("SHA1"); return item; } } internal class DSASignatureDescription : SignatureDescription { public DSASignatureDescription() { KeyAlgorithm = "System.Security.Cryptography.DSACryptoServiceProvider"; DigestAlgorithm = "System.Security.Cryptography.SHA1CryptoServiceProvider"; FormatterAlgorithm = "System.Security.Cryptography.DSASignatureFormatter"; DeformatterAlgorithm = "System.Security.Cryptography.DSASignatureDeformatter"; } } } // 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
- PathNode.cs
- CodeDirectoryCompiler.cs
- XmlBaseWriter.cs
- SqlDependencyListener.cs
- FlowDocumentView.cs
- ServiceProviders.cs
- BounceEase.cs
- SelectionPatternIdentifiers.cs
- ExpressionNode.cs
- View.cs
- XmlSchemaParticle.cs
- ActivityDefaults.cs
- DataSourceSelectArguments.cs
- UriScheme.cs
- dtdvalidator.cs
- FlowLayoutSettings.cs
- CombinedGeometry.cs
- QueryStringConverter.cs
- HyperLinkColumn.cs
- HtmlValidationSummaryAdapter.cs
- PreviewPageInfo.cs
- WebPartVerb.cs
- COM2Properties.cs
- RegexCapture.cs
- AlignmentYValidation.cs
- AuthStoreRoleProvider.cs
- SendContent.cs
- TextCompositionManager.cs
- ClientScriptManager.cs
- XsdDataContractExporter.cs
- filewebresponse.cs
- KnownBoxes.cs
- WbmpConverter.cs
- BigInt.cs
- SecondaryViewProvider.cs
- DefaultObjectMappingItemCollection.cs
- BindingOperations.cs
- XmlProcessingInstruction.cs
- LinearKeyFrames.cs
- SourceInterpreter.cs
- MemberExpressionHelper.cs
- XslVisitor.cs
- DataGrid.cs
- SendDesigner.xaml.cs
- InternalResources.cs
- DataGridComponentEditor.cs
- Maps.cs
- BookmarkCallbackWrapper.cs
- TrimSurroundingWhitespaceAttribute.cs
- UnsafeCollabNativeMethods.cs
- TraceInternal.cs
- QilXmlReader.cs
- PersonalizablePropertyEntry.cs
- FileIOPermission.cs
- QueueProcessor.cs
- WebPartZone.cs
- SemanticBasicElement.cs
- ObjectStateFormatter.cs
- VectorKeyFrameCollection.cs
- SynchronizedPool.cs
- WindowClosedEventArgs.cs
- SiteMapDataSource.cs
- DebugView.cs
- SystemFonts.cs
- BuildProviderInstallComponent.cs
- PageAdapter.cs
- TransactionManager.cs
- InlinedAggregationOperator.cs
- StackOverflowException.cs
- PointConverter.cs
- CodeConditionStatement.cs
- FileDetails.cs
- WebPartVerbCollection.cs
- RecordsAffectedEventArgs.cs
- DecimalMinMaxAggregationOperator.cs
- SortableBindingList.cs
- MdiWindowListItemConverter.cs
- TreeWalkHelper.cs
- FlatButtonAppearance.cs
- SchemaTableColumn.cs
- ArraySubsetEnumerator.cs
- SecurityToken.cs
- ProcessMonitor.cs
- XPathNodeList.cs
- SoapAttributeOverrides.cs
- Translator.cs
- MaterialCollection.cs
- TemplateModeChangedEventArgs.cs
- Menu.cs
- XmlSerializableServices.cs
- DbDataSourceEnumerator.cs
- ValuePattern.cs
- DbConnectionPool.cs
- ConnectionConsumerAttribute.cs
- OleDbWrapper.cs
- ProfileService.cs
- OneOf.cs
- _NestedMultipleAsyncResult.cs
- EraserBehavior.cs
- ResXResourceWriter.cs