Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Security / Cryptography / MD5CryptoServiceProvider.cs / 1 / MD5CryptoServiceProvider.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // MD5CryptoServiceProvider.cs // namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public sealed class MD5CryptoServiceProvider : MD5 { private SafeHashHandle _safeHashHandle = null; // // public constructors // public MD5CryptoServiceProvider() { if (Utils.FipsAlgorithmPolicy == 1) throw new InvalidOperationException(Environment.GetResourceString("Cryptography_NonCompliantFIPSAlgorithm")); SafeHashHandle safeHashHandle = SafeHashHandle.InvalidHandle; // _CreateHash will check for failures and throw the appropriate exception Utils._CreateHash(Utils.StaticProvHandle, Constants.CALG_MD5, ref safeHashHandle); _safeHashHandle = safeHashHandle; } protected override void Dispose(bool disposing) { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); base.Dispose(disposing); } // // public methods // public override void Initialize() { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); SafeHashHandle safeHashHandle = SafeHashHandle.InvalidHandle; // _CreateHash will check for failures and throw the appropriate exception Utils._CreateHash(Utils.StaticProvHandle, Constants.CALG_MD5, ref safeHashHandle); _safeHashHandle = safeHashHandle; } protected override void HashCore(byte[] rgb, int ibStart, int cbSize) { Utils._HashData(_safeHashHandle, rgb, ibStart, cbSize); } protected override byte[] HashFinal() { return Utils._EndHash(_safeHashHandle); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridViewImageColumn.cs
- TypeSource.cs
- ToolStripItemTextRenderEventArgs.cs
- sqlmetadatafactory.cs
- DefinitionUpdate.cs
- cryptoapiTransform.cs
- PrimarySelectionGlyph.cs
- ExitEventArgs.cs
- XmlFormatReaderGenerator.cs
- SubMenuStyleCollection.cs
- RefreshPropertiesAttribute.cs
- SrgsToken.cs
- FlowDocumentScrollViewer.cs
- SingleTagSectionHandler.cs
- WebPartConnectVerb.cs
- WebPartCancelEventArgs.cs
- BigInt.cs
- TreeNodeCollectionEditor.cs
- InteropTrackingRecord.cs
- DEREncoding.cs
- XmlQuerySequence.cs
- TransformerConfigurationWizardBase.cs
- TypeSystem.cs
- ChildrenQuery.cs
- RemotingAttributes.cs
- ContentPresenter.cs
- GeometryModel3D.cs
- WorkingDirectoryEditor.cs
- Utilities.cs
- TripleDESCryptoServiceProvider.cs
- ReverseQueryOperator.cs
- DllNotFoundException.cs
- ScalarRestriction.cs
- TextCollapsingProperties.cs
- MultiPropertyDescriptorGridEntry.cs
- XmlTextWriter.cs
- ProviderUtil.cs
- FilteredDataSetHelper.cs
- listitem.cs
- X509Certificate.cs
- Assert.cs
- DataSetUtil.cs
- PersonalizationState.cs
- SafeNativeMethodsCLR.cs
- CollectionBase.cs
- LogicalCallContext.cs
- StringTraceRecord.cs
- MarkupWriter.cs
- BinaryParser.cs
- validation.cs
- DesignerProperties.cs
- Event.cs
- recordstatefactory.cs
- EmptyCollection.cs
- SqlDependencyUtils.cs
- Atom10FormatterFactory.cs
- SmtpReplyReaderFactory.cs
- SqlCacheDependencySection.cs
- RightsManagementPermission.cs
- TileBrush.cs
- ValueSerializer.cs
- SqlUdtInfo.cs
- MailWebEventProvider.cs
- KeyBinding.cs
- BlockUIContainer.cs
- DataSourceGroupCollection.cs
- Transform3D.cs
- InvalidAsynchronousStateException.cs
- PopupControlService.cs
- ValidatingReaderNodeData.cs
- WebPartHelpVerb.cs
- PageThemeCodeDomTreeGenerator.cs
- StringStorage.cs
- Tablet.cs
- WebReferencesBuildProvider.cs
- EDesignUtil.cs
- TransportChannelListener.cs
- XmlDownloadManager.cs
- BamlWriter.cs
- DbConnectionPoolGroup.cs
- QueryConverter.cs
- AspNetRouteServiceHttpHandler.cs
- WindowsUpDown.cs
- Parser.cs
- EnumMember.cs
- ThrowHelper.cs
- ByeMessageApril2005.cs
- X509ChainElement.cs
- ClientConfigPaths.cs
- EndpointAddress.cs
- DataGridViewLayoutData.cs
- CloseSequenceResponse.cs
- DrawingContextWalker.cs
- COM2TypeInfoProcessor.cs
- CompilerGeneratedAttribute.cs
- TreeNodeBindingDepthConverter.cs
- LineServicesRun.cs
- BlurBitmapEffect.cs
- X509CertificateTokenFactoryCredential.cs
- ProxyGenerationError.cs