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
- InheritanceContextChangedEventManager.cs
- MethodBody.cs
- IndentTextWriter.cs
- HtmlGenericControl.cs
- OracleCommandBuilder.cs
- PageAdapter.cs
- RuleDefinitions.cs
- Timer.cs
- SortQuery.cs
- SchemaImporterExtension.cs
- RuntimeConfigLKG.cs
- SqlDataSourceCustomCommandEditor.cs
- BitmapScalingModeValidation.cs
- SmtpSection.cs
- PackageDigitalSignatureManager.cs
- SocketManager.cs
- SynchronizingStream.cs
- ExpanderAutomationPeer.cs
- AuthenticationService.cs
- WorkflowQueuingService.cs
- XpsFont.cs
- BitmapEffectInputData.cs
- EventLogPermissionEntry.cs
- ExtensionSimplifierMarkupObject.cs
- DataGridViewCellStateChangedEventArgs.cs
- XmlCharType.cs
- NativeMethods.cs
- LocalizeDesigner.cs
- ErrorHandler.cs
- UriExt.cs
- PagesSection.cs
- FormatConvertedBitmap.cs
- DataListItem.cs
- DbProviderFactories.cs
- ListenerBinder.cs
- StylusButtonEventArgs.cs
- ImageMap.cs
- CodeDomConfigurationHandler.cs
- Nodes.cs
- MouseDevice.cs
- SourceLocationProvider.cs
- QilExpression.cs
- NavigationPropertySingletonExpression.cs
- NullReferenceException.cs
- DataSourceXmlElementAttribute.cs
- DataGridItem.cs
- XPathBinder.cs
- DataFormats.cs
- Nullable.cs
- Int32RectValueSerializer.cs
- TextTreeRootTextBlock.cs
- SmtpMail.cs
- Attributes.cs
- SplineKeyFrames.cs
- MailWriter.cs
- PassportAuthentication.cs
- MembershipUser.cs
- QueryExpression.cs
- DatatypeImplementation.cs
- XmlSchemaDatatype.cs
- SQLSingleStorage.cs
- MachineKeySection.cs
- QuaternionIndependentAnimationStorage.cs
- Pts.cs
- HttpHandlerActionCollection.cs
- SimpleBitVector32.cs
- AmbientProperties.cs
- SslStream.cs
- SqlBulkCopyColumnMapping.cs
- TemplatePropertyEntry.cs
- CompiledRegexRunner.cs
- EventSinkActivityDesigner.cs
- MaskDescriptors.cs
- _ListenerAsyncResult.cs
- TlsSspiNegotiation.cs
- UnsafeMethods.cs
- XmlnsDictionary.cs
- ProcessManager.cs
- DataGridViewDataErrorEventArgs.cs
- SqlCacheDependency.cs
- ChtmlImageAdapter.cs
- Rotation3DAnimationBase.cs
- ColorContext.cs
- WebScriptClientGenerator.cs
- ThrowHelper.cs
- StreamWithDictionary.cs
- OleDbStruct.cs
- SerializationInfo.cs
- OutOfProcStateClientManager.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- DataGridViewCellParsingEventArgs.cs
- TreeViewImageKeyConverter.cs
- ReadOnlyCollection.cs
- HttpDigestClientCredential.cs
- Sorting.cs
- TrackingServices.cs
- ComponentChangingEvent.cs
- ExpressionBuilder.cs
- ElementsClipboardData.cs
- BufferModeSettings.cs