Code:
/ DotNET / DotNET / 8.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
- DbDataAdapter.cs
- ScopelessEnumAttribute.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- ToolStripScrollButton.cs
- ImageCodecInfoPrivate.cs
- PrivilegeNotHeldException.cs
- LayoutDump.cs
- XmlSchemaInfo.cs
- XmlBinaryWriter.cs
- RegexWriter.cs
- MDIWindowDialog.cs
- WmiInstallComponent.cs
- Socket.cs
- X509Utils.cs
- TypedTableGenerator.cs
- DoubleKeyFrameCollection.cs
- MimeTypeAttribute.cs
- Rectangle.cs
- ParserExtension.cs
- WCFModelStrings.Designer.cs
- CacheHelper.cs
- DotExpr.cs
- LookupBindingPropertiesAttribute.cs
- RC2.cs
- XmlSignatureManifest.cs
- HtmlLiteralTextAdapter.cs
- _SafeNetHandles.cs
- Operand.cs
- Animatable.cs
- HostingEnvironment.cs
- WorkflowCompensationBehavior.cs
- TraceListener.cs
- SecurityTokenTypes.cs
- XmlFormatReaderGenerator.cs
- EditCommandColumn.cs
- CommunicationObjectManager.cs
- CombinedGeometry.cs
- Label.cs
- PropertyChangedEventManager.cs
- MessageDecoder.cs
- InstanceOwnerException.cs
- FamilyTypeface.cs
- parserscommon.cs
- AbstractSvcMapFileLoader.cs
- Wizard.cs
- EntityContainer.cs
- IssuanceLicense.cs
- CodeEventReferenceExpression.cs
- PagerSettings.cs
- coordinator.cs
- MachineKeyConverter.cs
- WmfPlaceableFileHeader.cs
- SmiEventSink.cs
- CacheEntry.cs
- PublisherIdentityPermission.cs
- SectionUpdates.cs
- SystemDropShadowChrome.cs
- LassoSelectionBehavior.cs
- XmlNodeComparer.cs
- KeyTime.cs
- MultiAsyncResult.cs
- Math.cs
- ListViewDataItem.cs
- PublisherMembershipCondition.cs
- WindowsRichEdit.cs
- Events.cs
- BaseResourcesBuildProvider.cs
- PointConverter.cs
- Storyboard.cs
- RedistVersionInfo.cs
- ButtonBase.cs
- ClientCultureInfo.cs
- ChineseLunisolarCalendar.cs
- ObservableDictionary.cs
- SoapExtensionTypeElementCollection.cs
- FunctionDescription.cs
- FrameDimension.cs
- X509Chain.cs
- Timer.cs
- StreamUpdate.cs
- XPathBinder.cs
- ContainerVisual.cs
- Model3DGroup.cs
- XDeferredAxisSource.cs
- RecognizerInfo.cs
- ECDiffieHellman.cs
- TextParagraphView.cs
- MemberBinding.cs
- SplashScreenNativeMethods.cs
- DifferencingCollection.cs
- ISAPIWorkerRequest.cs
- TaiwanLunisolarCalendar.cs
- DispatcherSynchronizationContext.cs
- WebBrowserNavigatingEventHandler.cs
- MultiTrigger.cs
- Deserializer.cs
- DiscoveryClientDuplexChannel.cs
- TypedTableHandler.cs
- TaiwanLunisolarCalendar.cs
- RootDesignerSerializerAttribute.cs