Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Security / Cryptography / DSASignatureDeformatter.cs / 1 / DSASignatureDeformatter.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // DSASignatureDeformatter.cs // namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public class DSASignatureDeformatter : AsymmetricSignatureDeformatter { DSA _dsaKey; // DSA Key value to do decrypt operation string _oid; // // public constructors // public DSASignatureDeformatter() { // The hash algorithm is always SHA1 _oid = CryptoConfig.MapNameToOID("SHA1"); } public DSASignatureDeformatter(AsymmetricAlgorithm key) : this() { if (key == null) throw new ArgumentNullException("key"); _dsaKey = (DSA) key; } // // public methods // public override void SetKey(AsymmetricAlgorithm key) { if (key == null) throw new ArgumentNullException("key"); _dsaKey = (DSA) key; } public override void SetHashAlgorithm(string strName) { if (CryptoConfig.MapNameToOID(strName) != _oid) throw new CryptographicUnexpectedOperationException(Environment.GetResourceString("Cryptography_InvalidOperation")); } public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature) { if (_dsaKey == null) throw new CryptographicUnexpectedOperationException(Environment.GetResourceString("Cryptography_MissingKey")); if (rgbHash == null) throw new ArgumentNullException("rgbHash"); if (rgbSignature == null) throw new ArgumentNullException("rgbSignature"); return _dsaKey.VerifySignature(rgbHash, rgbSignature); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GraphicsState.cs
- ClientRolePrincipal.cs
- PublisherMembershipCondition.cs
- ExtendLockAsyncResult.cs
- UxThemeWrapper.cs
- MethodBuilderInstantiation.cs
- DataGridViewComboBoxColumnDesigner.cs
- ProcessModelSection.cs
- RepeaterCommandEventArgs.cs
- XmlnsCompatibleWithAttribute.cs
- HandlerBase.cs
- HostingEnvironment.cs
- StretchValidation.cs
- AuthenticatingEventArgs.cs
- ClientSettingsStore.cs
- OutputCacheProfileCollection.cs
- SessionStateModule.cs
- GlyphShapingProperties.cs
- InputProcessorProfilesLoader.cs
- ConfigXmlWhitespace.cs
- Window.cs
- ListParaClient.cs
- LinqDataSourceDeleteEventArgs.cs
- DataRelationCollection.cs
- ShapeTypeface.cs
- EncryptRequest.cs
- IdentityReference.cs
- Win32Exception.cs
- ChannelManager.cs
- ObjectCloneHelper.cs
- AssemblyName.cs
- PointCollection.cs
- SqlProfileProvider.cs
- GridView.cs
- ExtensibleSyndicationObject.cs
- MsmqIntegrationBinding.cs
- DBSqlParserColumnCollection.cs
- TemplateColumn.cs
- TypeExtension.cs
- DebugInfoGenerator.cs
- WindowsListViewItemStartMenu.cs
- TextShapeableCharacters.cs
- PathFigureCollection.cs
- SimpleExpression.cs
- DataGridViewLinkColumn.cs
- ListComponentEditorPage.cs
- SchemaImporterExtension.cs
- XmlSchemaSimpleContent.cs
- ConfigurationSectionGroup.cs
- BreadCrumbTextConverter.cs
- remotingproxy.cs
- CharacterHit.cs
- UniqueIdentifierService.cs
- Utility.cs
- XmlSchemaSimpleTypeUnion.cs
- CodeActivityContext.cs
- SQLRoleProvider.cs
- CompilerCollection.cs
- Main.cs
- Point4D.cs
- PageAdapter.cs
- SecurityHeaderLayout.cs
- ServicesUtilities.cs
- safex509handles.cs
- PropertyEntry.cs
- DynamicDiscoSearcher.cs
- _ContextAwareResult.cs
- DocumentOrderQuery.cs
- SynchronizedInputPattern.cs
- ObjectAssociationEndMapping.cs
- EventLogPermissionEntryCollection.cs
- LogAppendAsyncResult.cs
- MenuStrip.cs
- RSAPKCS1KeyExchangeFormatter.cs
- ElementHostPropertyMap.cs
- TypeConvertions.cs
- CorrelationManager.cs
- FragmentQuery.cs
- SolidColorBrush.cs
- MarkedHighlightComponent.cs
- LayoutEditorPart.cs
- PerformanceCountersElement.cs
- SqlCacheDependencyDatabase.cs
- XslNumber.cs
- ArrayConverter.cs
- DesignerActionPropertyItem.cs
- RtfToXamlLexer.cs
- FontStyle.cs
- SymmetricAlgorithm.cs
- PerformanceCounter.cs
- DependencyObjectPropertyDescriptor.cs
- TableLayoutSettingsTypeConverter.cs
- DataTableMapping.cs
- RuntimeResourceSet.cs
- precedingquery.cs
- TextParagraph.cs
- OrderByBuilder.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- SchemaInfo.cs
- EventLogEntry.cs