Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- LoadedEvent.cs
- LogExtentCollection.cs
- DispatchWrapper.cs
- RowParagraph.cs
- FormsAuthenticationUserCollection.cs
- EntityTypeEmitter.cs
- ModelTreeEnumerator.cs
- ReadOnlyNameValueCollection.cs
- DataGridViewLayoutData.cs
- SizeFConverter.cs
- SmiEventSink_Default.cs
- Control.cs
- SocketInformation.cs
- XmlNamespaceMapping.cs
- ContainerUtilities.cs
- Stopwatch.cs
- TypedColumnHandler.cs
- SoapInteropTypes.cs
- DispatchWrapper.cs
- GuidelineCollection.cs
- PolygonHotSpot.cs
- EntityAdapter.cs
- FolderBrowserDialogDesigner.cs
- DbMetaDataColumnNames.cs
- Listbox.cs
- CompositeScriptReference.cs
- BamlTreeMap.cs
- webbrowsersite.cs
- GridViewCellAutomationPeer.cs
- LineMetrics.cs
- ElementHost.cs
- RadioButtonBaseAdapter.cs
- RealProxy.cs
- WebPartTransformerAttribute.cs
- SchemaMapping.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- MemberJoinTreeNode.cs
- QueryStringParameter.cs
- RegionIterator.cs
- BindingList.cs
- RecipientInfo.cs
- ReturnEventArgs.cs
- HyperLinkDesigner.cs
- FusionWrap.cs
- EntityDataSourceContextDisposingEventArgs.cs
- SByteStorage.cs
- TextServicesCompartmentEventSink.cs
- ChildTable.cs
- MemberExpression.cs
- Simplifier.cs
- CSharpCodeProvider.cs
- StreamReader.cs
- WindowsSecurityTokenAuthenticator.cs
- ControlParameter.cs
- FontSizeConverter.cs
- VectorCollection.cs
- ToolStripArrowRenderEventArgs.cs
- TextServicesProperty.cs
- _ServiceNameStore.cs
- FormClosingEvent.cs
- LayoutEngine.cs
- SimpleHandlerFactory.cs
- KeyNotFoundException.cs
- Margins.cs
- LambdaCompiler.Generated.cs
- ButtonFieldBase.cs
- XamlRtfConverter.cs
- ValueOfAction.cs
- FontWeights.cs
- EqualityArray.cs
- FigureParagraph.cs
- FactoryGenerator.cs
- UnsafeNativeMethods.cs
- TableStyle.cs
- SoapSchemaImporter.cs
- SetStateEventArgs.cs
- ResXResourceSet.cs
- Atom10FormatterFactory.cs
- InvokeProviderWrapper.cs
- TextBreakpoint.cs
- HttpListenerRequestUriBuilder.cs
- ComponentDispatcherThread.cs
- Expressions.cs
- RowTypePropertyElement.cs
- BaseAutoFormat.cs
- _UriTypeConverter.cs
- BinaryReader.cs
- UnsafeNativeMethods.cs
- SchemaType.cs
- Light.cs
- RenderDataDrawingContext.cs
- SqlHelper.cs
- BuildProviderCollection.cs
- XmlUrlEditor.cs
- ToolStripLabel.cs
- AlphabetConverter.cs
- BooleanAnimationBase.cs
- SubMenuStyle.cs
- _HTTPDateParse.cs
- DbConnectionHelper.cs