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
- GridViewPageEventArgs.cs
- PeerInputChannel.cs
- FlowDocumentPageViewerAutomationPeer.cs
- UnsafeMethods.cs
- EditableLabelControl.cs
- TypeNameConverter.cs
- FixedPageStructure.cs
- SqlInternalConnectionTds.cs
- EntityAdapter.cs
- TreeNodeCollectionEditor.cs
- Permission.cs
- OdbcEnvironmentHandle.cs
- ProcessHostMapPath.cs
- PageThemeCodeDomTreeGenerator.cs
- ReliableSessionBindingElement.cs
- InternalEnumValidatorAttribute.cs
- ProviderIncompatibleException.cs
- Predicate.cs
- TablePattern.cs
- CollectionViewSource.cs
- ScriptRegistrationManager.cs
- LayeredChannelFactory.cs
- PointCollectionValueSerializer.cs
- PagePropertiesChangingEventArgs.cs
- EdmPropertyAttribute.cs
- ObjectConverter.cs
- TreeWalkHelper.cs
- ExecutionContext.cs
- PropertyGridCommands.cs
- XmlSchemaSimpleTypeUnion.cs
- CookieParameter.cs
- InitializerFacet.cs
- DiscoveryExceptionDictionary.cs
- MouseBinding.cs
- AutomationPropertyInfo.cs
- HwndSourceParameters.cs
- TaskbarItemInfo.cs
- SiteMapSection.cs
- ReadOnlyAttribute.cs
- AddInContractAttribute.cs
- PageAdapter.cs
- AspCompat.cs
- CurrentChangedEventManager.cs
- CodeTryCatchFinallyStatement.cs
- SourceFilter.cs
- NumericExpr.cs
- MetadataHelper.cs
- UnknownBitmapEncoder.cs
- CompilationSection.cs
- Repeater.cs
- FacetDescription.cs
- ServiceManager.cs
- QfeChecker.cs
- Internal.cs
- NameTable.cs
- IndentedWriter.cs
- OleCmdHelper.cs
- QuaternionAnimationBase.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- WorkflowWebHostingModule.cs
- GetPageCompletedEventArgs.cs
- AllMembershipCondition.cs
- EventEntry.cs
- TextRunCacheImp.cs
- FileSystemWatcher.cs
- Rule.cs
- Knowncolors.cs
- Attributes.cs
- FormattedText.cs
- SafeNativeMethodsMilCoreApi.cs
- EditorPartChrome.cs
- XmlAttributeCache.cs
- Attribute.cs
- XmlSchemaSimpleContent.cs
- IOThreadScheduler.cs
- PageContentCollection.cs
- SplayTreeNode.cs
- TraceInternal.cs
- TextBoxAutoCompleteSourceConverter.cs
- RowBinding.cs
- CryptoProvider.cs
- MethodExpr.cs
- GridSplitter.cs
- XmlResolver.cs
- Span.cs
- SqlDataSourceAdvancedOptionsForm.cs
- BindMarkupExtensionSerializer.cs
- TableHeaderCell.cs
- XmlSchemaComplexType.cs
- InvalidComObjectException.cs
- ResourceExpressionBuilder.cs
- SEHException.cs
- SingleStorage.cs
- StrokeNodeOperations2.cs
- Stroke.cs
- BitmapSource.cs
- CalendarDayButton.cs
- SqlDataSourceStatusEventArgs.cs
- ToolStripContainer.cs
- Color.cs