Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Cryptography / DSASignatureDeformatter.cs / 1305376 / DSASignatureDeformatter.cs
using System.Diagnostics.Contracts; // ==++== // // 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"); Contract.EndContractBlock(); _dsaKey = (DSA) key; } // // public methods // public override void SetKey(AsymmetricAlgorithm key) { if (key == null) throw new ArgumentNullException("key"); Contract.EndContractBlock(); _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 (rgbHash == null) throw new ArgumentNullException("rgbHash"); if (rgbSignature == null) throw new ArgumentNullException("rgbSignature"); Contract.EndContractBlock(); if (_dsaKey == null) throw new CryptographicUnexpectedOperationException(Environment.GetResourceString("Cryptography_MissingKey")); return _dsaKey.VerifySignature(rgbHash, rgbSignature); } } } // 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
- SmtpException.cs
- FlowDocumentView.cs
- RadialGradientBrush.cs
- SqlConnectionHelper.cs
- WindowsTitleBar.cs
- RangeBaseAutomationPeer.cs
- CheckBox.cs
- DebugInfoExpression.cs
- Exceptions.cs
- StrokeCollectionDefaultValueFactory.cs
- NetSectionGroup.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- NominalTypeEliminator.cs
- wmiprovider.cs
- SqlProviderManifest.cs
- AvTrace.cs
- PopupRootAutomationPeer.cs
- FlowLayoutPanel.cs
- FieldNameLookup.cs
- Image.cs
- VirtualizedCellInfoCollection.cs
- RuleSetDialog.Designer.cs
- StateWorkerRequest.cs
- SrgsText.cs
- ZoomPercentageConverter.cs
- ISAPIApplicationHost.cs
- SimpleApplicationHost.cs
- XmlSchemaAnnotation.cs
- IteratorFilter.cs
- ToolTipAutomationPeer.cs
- TraceHandler.cs
- PlatformCulture.cs
- FocusManager.cs
- DbBuffer.cs
- EdmItemCollection.cs
- ParallelDesigner.cs
- TimeStampChecker.cs
- EdmProperty.cs
- brushes.cs
- TopClause.cs
- WindowsRichEdit.cs
- RegexCompilationInfo.cs
- HttpModuleCollection.cs
- XmlDataSourceNodeDescriptor.cs
- WebPartTransformerCollection.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- RowBinding.cs
- SchemaCollectionCompiler.cs
- ApplicationActivator.cs
- CodeGenerator.cs
- BitmapScalingModeValidation.cs
- SqlColumnizer.cs
- SmiRequestExecutor.cs
- QueueProcessor.cs
- BindingExpressionUncommonField.cs
- UIElementIsland.cs
- categoryentry.cs
- DesignSurfaceManager.cs
- UserControlAutomationPeer.cs
- StateMachineHelpers.cs
- XmlSchemaGroup.cs
- CroppedBitmap.cs
- RelationshipWrapper.cs
- Freezable.cs
- TextEditorLists.cs
- QueryContinueDragEventArgs.cs
- BamlResourceContent.cs
- GiveFeedbackEvent.cs
- View.cs
- ProcessRequestArgs.cs
- FormViewPageEventArgs.cs
- HttpWebResponse.cs
- propertytag.cs
- HtmlLink.cs
- DrawingBrush.cs
- ConfigurationManagerInternal.cs
- _ScatterGatherBuffers.cs
- RegularExpressionValidator.cs
- VScrollBar.cs
- AdCreatedEventArgs.cs
- CornerRadiusConverter.cs
- HotSpotCollection.cs
- Int32AnimationBase.cs
- ErrorInfoXmlDocument.cs
- ProfileSection.cs
- WebReference.cs
- ReflectionTypeLoadException.cs
- InputLangChangeEvent.cs
- DeflateStream.cs
- XmlSortKeyAccumulator.cs
- SerializerWriterEventHandlers.cs
- UIElementIsland.cs
- BinaryConverter.cs
- Pkcs9Attribute.cs
- ColumnResizeUndoUnit.cs
- TimerElapsedEvenArgs.cs
- BaseAddressElementCollection.cs
- ThreadExceptionDialog.cs
- FolderNameEditor.cs
- CustomErrorsSection.cs