Code:
/ FX-1434 / FX-1434 / 1.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
- XmlLoader.cs
- CommittableTransaction.cs
- VBCodeProvider.cs
- DataGridViewSelectedCellCollection.cs
- EncryptedKey.cs
- PartialTrustHelpers.cs
- AutomationTextAttribute.cs
- FixedSchema.cs
- UserValidatedEventArgs.cs
- Baml2006KeyRecord.cs
- RightsManagementPermission.cs
- DockPatternIdentifiers.cs
- ScriptControl.cs
- _Events.cs
- TreeViewHitTestInfo.cs
- StylusLogic.cs
- Stacktrace.cs
- FontInfo.cs
- PowerStatus.cs
- List.cs
- M3DUtil.cs
- HttpResponse.cs
- QilStrConcat.cs
- SapiRecognizer.cs
- IntegerFacetDescriptionElement.cs
- SigningDialog.cs
- SafeNativeMethods.cs
- InputManager.cs
- PageAsyncTask.cs
- DataGridViewCellStyle.cs
- Crc32.cs
- BrushMappingModeValidation.cs
- StylusPoint.cs
- SHA384Managed.cs
- MinMaxParagraphWidth.cs
- SafeNativeMethodsCLR.cs
- StandardOleMarshalObject.cs
- OracleCommandSet.cs
- DropShadowEffect.cs
- _BasicClient.cs
- MetadataHelper.cs
- namescope.cs
- Expander.cs
- AsyncSerializedWorker.cs
- HttpDictionary.cs
- WmpBitmapDecoder.cs
- XmlDataCollection.cs
- EntryPointNotFoundException.cs
- RightsManagementErrorHandler.cs
- HttpException.cs
- MultiView.cs
- Mapping.cs
- CodeStatementCollection.cs
- UnsafeNativeMethods.cs
- AttachmentCollection.cs
- ChangeInterceptorAttribute.cs
- TemplateManager.cs
- DetailsViewPagerRow.cs
- SQLDateTimeStorage.cs
- ResourceSet.cs
- UrlMappingsSection.cs
- ProfileModule.cs
- SessionParameter.cs
- TextDpi.cs
- UTF7Encoding.cs
- AppLevelCompilationSectionCache.cs
- HandleExceptionArgs.cs
- WebPartDescription.cs
- PlaceHolder.cs
- XmlSerializerSection.cs
- RegexStringValidatorAttribute.cs
- MetadataItemCollectionFactory.cs
- SystemIPGlobalStatistics.cs
- Point3D.cs
- ConfigXmlElement.cs
- ToolStripContentPanelDesigner.cs
- SQLDoubleStorage.cs
- MemoryFailPoint.cs
- FormClosedEvent.cs
- PropertyPathWorker.cs
- HttpRequestCacheValidator.cs
- DiscoveryServiceExtension.cs
- SerialReceived.cs
- KeyValueSerializer.cs
- Assembly.cs
- ComponentDispatcherThread.cs
- RadioButtonRenderer.cs
- Accessible.cs
- Stack.cs
- Baml6Assembly.cs
- ParallelSeparator.xaml.cs
- DesignerAttribute.cs
- CodeIndexerExpression.cs
- Transactions.cs
- VisualTreeUtils.cs
- EntityDataSourceWrapperCollection.cs
- FtpWebRequest.cs
- TabControl.cs
- FontWeight.cs
- DataGridViewRowCancelEventArgs.cs