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
- ParallelRangeManager.cs
- WebMessageEncodingElement.cs
- AnonymousIdentificationSection.cs
- HtmlInputControl.cs
- DelegateBodyWriter.cs
- Stack.cs
- FreezableOperations.cs
- FlowLayout.cs
- ConfigXmlCDataSection.cs
- WebUtil.cs
- SecurityProtocolFactory.cs
- SByteStorage.cs
- ResXResourceSet.cs
- FileDialogPermission.cs
- Timeline.cs
- MsmqNonTransactedPoisonHandler.cs
- TextDecorationUnitValidation.cs
- DCSafeHandle.cs
- ObjectDataSourceView.cs
- StandardToolWindows.cs
- DataKey.cs
- XsltQilFactory.cs
- configsystem.cs
- MenuItemBinding.cs
- DataGridBoolColumn.cs
- Variable.cs
- EnvelopedPkcs7.cs
- XmlTextEncoder.cs
- XmlPropertyBag.cs
- securitymgrsite.cs
- ResponseStream.cs
- VersionedStreamOwner.cs
- ColorConverter.cs
- ReferenceAssemblyAttribute.cs
- CodeMemberMethod.cs
- AuthenticodeSignatureInformation.cs
- TemplateGroupCollection.cs
- SerializerProvider.cs
- DataSourceSelectArguments.cs
- Vector3dCollection.cs
- SplashScreenNativeMethods.cs
- Win32SafeHandles.cs
- Int32AnimationUsingKeyFrames.cs
- DocComment.cs
- ClientUtils.cs
- ToolStripSeparator.cs
- Literal.cs
- ValidationResult.cs
- MessageQueuePermission.cs
- TaiwanCalendar.cs
- DefaultValidator.cs
- XamlToRtfWriter.cs
- SafeNativeMethods.cs
- MultiBinding.cs
- HttpCacheVary.cs
- DeviceSpecificChoiceCollection.cs
- _ScatterGatherBuffers.cs
- HtmlPhoneCallAdapter.cs
- Transform.cs
- LinearQuaternionKeyFrame.cs
- SoapDocumentMethodAttribute.cs
- ApplicationBuildProvider.cs
- FunctionDescription.cs
- ReverseInheritProperty.cs
- HTTPNotFoundHandler.cs
- StreamingContext.cs
- WinEventHandler.cs
- BitmapEncoder.cs
- FileCodeGroup.cs
- ObjectDataSourceSelectingEventArgs.cs
- DependencyProperty.cs
- Track.cs
- Frame.cs
- RectAnimationUsingKeyFrames.cs
- IConvertible.cs
- SmiEventSink_Default.cs
- SafeLibraryHandle.cs
- EntityClientCacheKey.cs
- WpfGeneratedKnownTypes.cs
- VisualTreeUtils.cs
- FontStyles.cs
- PropertyToken.cs
- RemoteWebConfigurationHostServer.cs
- MenuItemStyleCollection.cs
- BookmarkTable.cs
- CryptoHelper.cs
- Char.cs
- NativeActivityContext.cs
- HandlerWithFactory.cs
- _Semaphore.cs
- DataGridViewComponentPropertyGridSite.cs
- SystemFonts.cs
- SqlReferenceCollection.cs
- Wizard.cs
- NativeMethods.cs
- ContravarianceAdapter.cs
- CrossContextChannel.cs
- IsolatedStorageException.cs
- HierarchicalDataBoundControlAdapter.cs
- DES.cs