Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ClientScriptManager.cs
- ObjectCloneHelper.cs
- ScrollBar.cs
- RewritingSimplifier.cs
- WindowPattern.cs
- PageRanges.cs
- categoryentry.cs
- StateChangeEvent.cs
- DelayLoadType.cs
- NavigationCommands.cs
- BooleanExpr.cs
- ImageButton.cs
- TagPrefixCollection.cs
- AnonymousIdentificationSection.cs
- ReferentialConstraintRoleElement.cs
- QueryCacheKey.cs
- ProfileSettings.cs
- XmlSchemaSimpleTypeList.cs
- OuterGlowBitmapEffect.cs
- IRCollection.cs
- X509ChainElement.cs
- Double.cs
- AttachmentCollection.cs
- RangeBase.cs
- _UncName.cs
- ConfigurationLockCollection.cs
- ExtensionFile.cs
- WebPartZoneBase.cs
- XmlSortKey.cs
- webproxy.cs
- BitmapScalingModeValidation.cs
- SwitchLevelAttribute.cs
- DbSource.cs
- OperationPerformanceCounters.cs
- SynthesizerStateChangedEventArgs.cs
- SetUserPreferenceRequest.cs
- PlatformCulture.cs
- BCLDebug.cs
- HyperLinkStyle.cs
- TableRowGroup.cs
- MinimizableAttributeTypeConverter.cs
- FacetDescriptionElement.cs
- TripleDES.cs
- _WebProxyDataBuilder.cs
- ConstructorNeedsTagAttribute.cs
- AspNetCacheProfileAttribute.cs
- HttpClientCertificate.cs
- NavigatingCancelEventArgs.cs
- HttpServerUtilityWrapper.cs
- DataSourceProvider.cs
- AppSettingsExpressionBuilder.cs
- XmlObjectSerializerWriteContextComplex.cs
- ArrayConverter.cs
- HashCodeCombiner.cs
- XmlParserContext.cs
- DataGridViewColumnCollection.cs
- UnsafeNativeMethodsPenimc.cs
- TTSVoice.cs
- FirstMatchCodeGroup.cs
- XmlSchemaSimpleContentRestriction.cs
- ColorConverter.cs
- EditingScope.cs
- InvalidCommandTreeException.cs
- GeometryValueSerializer.cs
- DbCommandDefinition.cs
- HyperLinkColumn.cs
- PartialList.cs
- HtmlDocument.cs
- WinOEToolBoxItem.cs
- SQLBytesStorage.cs
- Config.cs
- AssemblyHash.cs
- CodeSnippetExpression.cs
- NativeMethods.cs
- QuaternionConverter.cs
- NavigationWindowAutomationPeer.cs
- EncryptedPackageFilter.cs
- FileNameEditor.cs
- EntityDataSourceSelectingEventArgs.cs
- Point3DCollection.cs
- ContractInferenceHelper.cs
- AttachInfo.cs
- XhtmlConformanceSection.cs
- SplitterCancelEvent.cs
- FileNotFoundException.cs
- GridViewColumnHeader.cs
- SecurityUtils.cs
- TypeConvertions.cs
- ExecutedRoutedEventArgs.cs
- BuildProviderInstallComponent.cs
- BaseUriHelper.cs
- NotifyCollectionChangedEventArgs.cs
- GenericUI.cs
- TransformedBitmap.cs
- SQLBytes.cs
- ProtocolElement.cs
- LineInfo.cs
- ExpressionHelper.cs
- HttpProxyCredentialType.cs
- DefaultValueConverter.cs