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
- Activator.cs
- ProcessInputEventArgs.cs
- SafeNativeMethods.cs
- validation.cs
- DragEvent.cs
- X509Extension.cs
- RootDesignerSerializerAttribute.cs
- DataGridViewCellStateChangedEventArgs.cs
- ScriptIgnoreAttribute.cs
- XmlSchemaComplexType.cs
- RoleGroup.cs
- FontStyleConverter.cs
- CodeParameterDeclarationExpression.cs
- MultipleViewProviderWrapper.cs
- webclient.cs
- ToolStripCodeDomSerializer.cs
- util.cs
- Base64WriteStateInfo.cs
- XmlCharType.cs
- PeerName.cs
- IntSecurity.cs
- DataGridViewRowCancelEventArgs.cs
- BlockCollection.cs
- HttpCookieCollection.cs
- DragStartedEventArgs.cs
- HttpModuleCollection.cs
- SizeChangedEventArgs.cs
- DiscreteKeyFrames.cs
- ServiceOperationDetailViewControl.cs
- RootProfilePropertySettingsCollection.cs
- PropertyChangeTracker.cs
- ObjectDisposedException.cs
- DynamicControlParameter.cs
- TemplatedAdorner.cs
- SHA512.cs
- CustomAttribute.cs
- ResizeGrip.cs
- MarshalByRefObject.cs
- ToolStripComboBox.cs
- Variable.cs
- XmlILStorageConverter.cs
- ControlAdapter.cs
- Application.cs
- HScrollProperties.cs
- Transform3DGroup.cs
- EastAsianLunisolarCalendar.cs
- FormsIdentity.cs
- CodeLabeledStatement.cs
- LeafCellTreeNode.cs
- ButtonField.cs
- SettingsSection.cs
- EdmPropertyAttribute.cs
- SuppressIldasmAttribute.cs
- DelegateBodyWriter.cs
- PropertySet.cs
- EditorPartCollection.cs
- ColorDialog.cs
- ListControl.cs
- DataContractJsonSerializerOperationFormatter.cs
- CodeDOMUtility.cs
- FormViewDesigner.cs
- PenThreadWorker.cs
- HttpResponseInternalWrapper.cs
- BatchParser.cs
- PropertyNames.cs
- Matrix.cs
- HostingEnvironmentException.cs
- WorkflowViewService.cs
- MergablePropertyAttribute.cs
- DbCommandTree.cs
- GZipUtils.cs
- base64Transforms.cs
- NumberFormatter.cs
- dbdatarecord.cs
- AutomationPatternInfo.cs
- MimeMultiPart.cs
- VolatileResourceManager.cs
- MarshalByValueComponent.cs
- ForeignKeyConstraint.cs
- UserControlCodeDomTreeGenerator.cs
- PlainXmlWriter.cs
- StyleBamlRecordReader.cs
- TryExpression.cs
- XmlParser.cs
- TypePresenter.xaml.cs
- CancellationToken.cs
- InternalBase.cs
- CachingHintValidation.cs
- TextServicesManager.cs
- ComponentDispatcher.cs
- EmptyQuery.cs
- WebServiceErrorEvent.cs
- JapaneseLunisolarCalendar.cs
- KeySpline.cs
- QilExpression.cs
- DictionaryBase.cs
- TogglePatternIdentifiers.cs
- ImplicitInputBrush.cs
- hresults.cs
- TypeConvertions.cs