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
- uribuilder.cs
- PartitionResolver.cs
- InvariantComparer.cs
- EUCJPEncoding.cs
- SqlFunctionAttribute.cs
- PopupRootAutomationPeer.cs
- ValueProviderWrapper.cs
- QueryStringHandler.cs
- HtmlButton.cs
- CustomActivityDesigner.cs
- oledbconnectionstring.cs
- DiscreteKeyFrames.cs
- IsolatedStoragePermission.cs
- NullableDoubleAverageAggregationOperator.cs
- CachedBitmap.cs
- Compiler.cs
- WaitForChangedResult.cs
- UnsafeNativeMethods.cs
- InteropAutomationProvider.cs
- RoleServiceManager.cs
- CompoundFileStorageReference.cs
- HttpPostedFile.cs
- XmlComment.cs
- Listener.cs
- SecurityTokenResolver.cs
- diagnosticsswitches.cs
- SortedDictionary.cs
- FontCacheLogic.cs
- ControlBuilderAttribute.cs
- TagMapCollection.cs
- CreateParams.cs
- DataViewSetting.cs
- SerializationInfoEnumerator.cs
- ToolStripOverflowButton.cs
- _CookieModule.cs
- GenericAuthenticationEventArgs.cs
- XmlIgnoreAttribute.cs
- ConnectionsZoneDesigner.cs
- TableRowCollection.cs
- RegexTree.cs
- DirectoryObjectSecurity.cs
- RTTrackingProfile.cs
- XmlFormatReaderGenerator.cs
- DebuggerAttributes.cs
- HttpRequest.cs
- URLIdentityPermission.cs
- RtfControls.cs
- BuildManager.cs
- TextBoxBase.cs
- BadImageFormatException.cs
- BoundPropertyEntry.cs
- ResponseStream.cs
- FlowDocumentScrollViewer.cs
- ArglessEventHandlerProxy.cs
- IisTraceWebEventProvider.cs
- ValueSerializer.cs
- ArrangedElement.cs
- TemplateBindingExtension.cs
- FaultImportOptions.cs
- EntityProxyFactory.cs
- DataGridViewSortCompareEventArgs.cs
- ImageListStreamer.cs
- XmlSchemaElement.cs
- InstanceOwnerQueryResult.cs
- ObjectListGeneralPage.cs
- WebPartZoneCollection.cs
- TemplateInstanceAttribute.cs
- _HTTPDateParse.cs
- DocumentReference.cs
- Base64WriteStateInfo.cs
- ComNativeDescriptor.cs
- XamlBrushSerializer.cs
- Matrix.cs
- CollectionDataContractAttribute.cs
- AsyncOperation.cs
- SystemFonts.cs
- ColumnProvider.cs
- TypeConverterHelper.cs
- StylusDevice.cs
- DispatcherTimer.cs
- SingleTagSectionHandler.cs
- ExpressionPrinter.cs
- LineInfo.cs
- InvalidEnumArgumentException.cs
- ValidationSummary.cs
- DataRowView.cs
- ExpressionTextBox.xaml.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- RectangleGeometry.cs
- GridErrorDlg.cs
- LineInfo.cs
- CommandValueSerializer.cs
- ServerIdentity.cs
- SplitterCancelEvent.cs
- ReadOnlyAttribute.cs
- HttpPostProtocolReflector.cs
- RegexNode.cs
- DebugHandleTracker.cs
- DependencyObject.cs
- InstanceCompleteException.cs