Code:
/ FX-1434 / FX-1434 / 1.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
- DispatcherOperation.cs
- PageStatePersister.cs
- SessionStateItemCollection.cs
- ProjectionNode.cs
- Vars.cs
- XDeferredAxisSource.cs
- connectionpool.cs
- TextParagraph.cs
- ToolBar.cs
- RepeaterCommandEventArgs.cs
- SQLChars.cs
- NamespaceQuery.cs
- ListViewItemMouseHoverEvent.cs
- ClientSponsor.cs
- HostingMessageProperty.cs
- AsymmetricKeyExchangeDeformatter.cs
- IntellisenseTextBox.designer.cs
- RightsManagementProvider.cs
- XmlAnyAttributeAttribute.cs
- HwndKeyboardInputProvider.cs
- SQLUtility.cs
- JsonClassDataContract.cs
- DeviceContexts.cs
- RoutedCommand.cs
- UIElementAutomationPeer.cs
- BaseParaClient.cs
- IndexedString.cs
- DBAsyncResult.cs
- PackageRelationship.cs
- EntityClientCacheEntry.cs
- InlineObject.cs
- LogRestartAreaEnumerator.cs
- NamedElement.cs
- IItemProperties.cs
- FlagsAttribute.cs
- SqlVersion.cs
- CodeSubDirectoriesCollection.cs
- StorageRoot.cs
- Context.cs
- XmlSchemaGroup.cs
- MetadataStore.cs
- DocumentApplication.cs
- MultiDataTrigger.cs
- DataServiceRequestOfT.cs
- CommandValueSerializer.cs
- PasswordBoxAutomationPeer.cs
- DataGrid.cs
- RuntimeWrappedException.cs
- IOThreadScheduler.cs
- FileBasedResourceGroveler.cs
- Double.cs
- SiteMapNodeItemEventArgs.cs
- MsmqTransportSecurity.cs
- Calendar.cs
- ListViewDataItem.cs
- AsymmetricSignatureFormatter.cs
- TimeIntervalCollection.cs
- HelloOperationCD1AsyncResult.cs
- RequestQueue.cs
- EntitySetBase.cs
- Section.cs
- EditorZone.cs
- BasicCellRelation.cs
- DropSource.cs
- AuthenticationSection.cs
- StringConverter.cs
- DiscoveryProxy.cs
- DataGridHeaderBorder.cs
- columnmapfactory.cs
- OleDbCommandBuilder.cs
- RoleServiceManager.cs
- HttpServerChannel.cs
- CompilationUtil.cs
- NumericUpDownAccelerationCollection.cs
- SystemResourceHost.cs
- ServiceNameElementCollection.cs
- LocatorPartList.cs
- ProtocolsConfigurationEntry.cs
- ContentValidator.cs
- FixedTextView.cs
- RuntimeHandles.cs
- Model3DCollection.cs
- HostingMessageProperty.cs
- RubberbandSelector.cs
- ObjectHandle.cs
- CompositionAdorner.cs
- OutputScopeManager.cs
- CachedTypeface.cs
- DbMetaDataFactory.cs
- MessageFormatterConverter.cs
- XmlSerializationReader.cs
- SourceFileInfo.cs
- PhysicalFontFamily.cs
- RegexGroupCollection.cs
- ExtensionMethods.cs
- EntityContainerAssociationSetEnd.cs
- VScrollProperties.cs
- DataViewManagerListItemTypeDescriptor.cs
- dbenumerator.cs
- SspiWrapper.cs