Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Security / Cryptography / DSASignatureFormatter.cs / 1 / DSASignatureFormatter.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // DSASignatureFormatter.cs // namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public class DSASignatureFormatter : AsymmetricSignatureFormatter { DSA _dsaKey; String _oid; // // public constructors // public DSASignatureFormatter() { // The hash algorithm is always SHA1 _oid = CryptoConfig.MapNameToOID("SHA1"); } public DSASignatureFormatter(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 byte[] CreateSignature(byte[] rgbHash) { if (_oid == null) throw new CryptographicUnexpectedOperationException(Environment.GetResourceString("Cryptography_MissingOID")); if (_dsaKey == null) throw new CryptographicUnexpectedOperationException(Environment.GetResourceString("Cryptography_MissingKey")); if (rgbHash == null) throw new ArgumentNullException("rgbHash"); return _dsaKey.CreateSignature(rgbHash); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HandlerBase.cs
- SmtpReplyReader.cs
- LinqDataSourceUpdateEventArgs.cs
- FacetEnabledSchemaElement.cs
- DragEventArgs.cs
- AudioFormatConverter.cs
- PrimaryKeyTypeConverter.cs
- _Connection.cs
- TemplateInstanceAttribute.cs
- DesignTimeData.cs
- Trace.cs
- EndpointDiscoveryMetadata.cs
- MenuItem.cs
- MetadataPropertyAttribute.cs
- SpeechSynthesizer.cs
- FormViewUpdateEventArgs.cs
- DecimalAverageAggregationOperator.cs
- PersistChildrenAttribute.cs
- Currency.cs
- MutexSecurity.cs
- WindowsTab.cs
- NullableFloatMinMaxAggregationOperator.cs
- WarningException.cs
- ItemChangedEventArgs.cs
- CommonDialog.cs
- DateTimePicker.cs
- FontStretch.cs
- TextBreakpoint.cs
- QilCloneVisitor.cs
- ObjectQuery_EntitySqlExtensions.cs
- ContentType.cs
- JpegBitmapEncoder.cs
- ValueProviderWrapper.cs
- XmlElement.cs
- WindowInteropHelper.cs
- ThreadExceptionDialog.cs
- SiteMapProvider.cs
- RectangleF.cs
- JapaneseLunisolarCalendar.cs
- MLangCodePageEncoding.cs
- UpdatePanel.cs
- RuleSettings.cs
- GroupBoxRenderer.cs
- NullExtension.cs
- CapabilitiesAssignment.cs
- ErrorFormatter.cs
- XPathDocumentBuilder.cs
- __Error.cs
- WindowsStreamSecurityUpgradeProvider.cs
- CachedBitmap.cs
- RegexParser.cs
- HtmlEmptyTagControlBuilder.cs
- BaseTemplateBuildProvider.cs
- QueryStringParameter.cs
- AlignmentYValidation.cs
- graph.cs
- Message.cs
- BulletDecorator.cs
- _ProxyChain.cs
- AutomationAttributeInfo.cs
- SqlReferenceCollection.cs
- ContractSearchPattern.cs
- sqlcontext.cs
- WsdlBuildProvider.cs
- ListQueryResults.cs
- ButtonStandardAdapter.cs
- NonSerializedAttribute.cs
- Transform.cs
- externdll.cs
- SecurityVerifiedMessage.cs
- TextSpan.cs
- ChannelTracker.cs
- ClientRuntime.cs
- RealProxy.cs
- DataGrid.cs
- Viewport3DAutomationPeer.cs
- BaseWebProxyFinder.cs
- PackWebRequestFactory.cs
- ListViewInsertEventArgs.cs
- TableLayoutSettings.cs
- TypefaceMetricsCache.cs
- DrawingContextWalker.cs
- ZipIOLocalFileBlock.cs
- EllipseGeometry.cs
- ToolboxItemCollection.cs
- ClockGroup.cs
- ObjectCacheSettings.cs
- OleDbCommandBuilder.cs
- Byte.cs
- Suspend.cs
- ChannelFactoryRefCache.cs
- DesignSurfaceCollection.cs
- WebPartCatalogCloseVerb.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- HttpWebRequestElement.cs
- Debugger.cs
- MembershipPasswordException.cs
- CodeSubDirectoriesCollection.cs
- HyperLinkDesigner.cs
- XmlSchemaImporter.cs