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
- AnimationStorage.cs
- BoundPropertyEntry.cs
- HttpValueCollection.cs
- OdbcDataReader.cs
- ExtendedPropertyCollection.cs
- XmlSignatureProperties.cs
- ApplicationFileParser.cs
- XmlSchemaAppInfo.cs
- SequenceDesignerAccessibleObject.cs
- ImageList.cs
- NetPeerTcpBindingCollectionElement.cs
- NumberEdit.cs
- SpecialFolderEnumConverter.cs
- GlobalizationAssembly.cs
- SQLString.cs
- TypefaceMap.cs
- XmlElementCollection.cs
- ComponentResourceKeyConverter.cs
- HitTestWithGeometryDrawingContextWalker.cs
- ToolboxSnapDragDropEventArgs.cs
- MemberHolder.cs
- securestring.cs
- DesignerTextViewAdapter.cs
- UserControl.cs
- Manipulation.cs
- TargetControlTypeAttribute.cs
- XmlReflectionImporter.cs
- WasHostedComPlusFactory.cs
- KeyInterop.cs
- StickyNoteHelper.cs
- XmlResolver.cs
- EventMappingSettingsCollection.cs
- EventMappingSettings.cs
- DataGridLength.cs
- Stack.cs
- XmlMemberMapping.cs
- IDQuery.cs
- SkinBuilder.cs
- ConnectionConsumerAttribute.cs
- GenericUriParser.cs
- ThemeDirectoryCompiler.cs
- recordstate.cs
- securitycriticaldataformultiplegetandset.cs
- RadioButton.cs
- ContainerControl.cs
- CuspData.cs
- RegexRunnerFactory.cs
- ScriptResourceAttribute.cs
- OdbcParameterCollection.cs
- ConnectionStringEditor.cs
- BaseCodeDomTreeGenerator.cs
- CheckBox.cs
- LinkUtilities.cs
- CheckBox.cs
- ArraySubsetEnumerator.cs
- Ipv6Element.cs
- CommandDevice.cs
- OrCondition.cs
- ListMarkerLine.cs
- LocalIdCollection.cs
- CheckedListBox.cs
- SqlServices.cs
- BindingSourceDesigner.cs
- CompleteWizardStep.cs
- GPPOINT.cs
- VirtualizingPanel.cs
- SqlRowUpdatingEvent.cs
- MulticastNotSupportedException.cs
- MouseActionValueSerializer.cs
- Axis.cs
- _FtpControlStream.cs
- StackSpiller.Bindings.cs
- SettingsAttributeDictionary.cs
- PtsContext.cs
- ellipse.cs
- Figure.cs
- BindableTemplateBuilder.cs
- assertwrapper.cs
- RequestSecurityToken.cs
- ResourceDescriptionAttribute.cs
- EntityProxyFactory.cs
- SymDocumentType.cs
- ApplyTemplatesAction.cs
- UnsafeNativeMethods.cs
- SystemResources.cs
- SerTrace.cs
- XmlSchemaSimpleTypeRestriction.cs
- shaperfactoryquerycachekey.cs
- FileVersionInfo.cs
- ProfileSettings.cs
- CompositeDataBoundControl.cs
- TimelineGroup.cs
- RangeBaseAutomationPeer.cs
- DataBoundLiteralControl.cs
- UTF32Encoding.cs
- DiagnosticTraceSource.cs
- WaitHandle.cs
- UrlRoutingHandler.cs
- TdsParserSessionPool.cs
- WindowsListViewSubItem.cs