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
- Stack.cs
- UndoManager.cs
- ContextMenuAutomationPeer.cs
- RightsManagementErrorHandler.cs
- ActionNotSupportedException.cs
- TextBoxAutomationPeer.cs
- DataGridViewRowConverter.cs
- XsdCachingReader.cs
- FragmentNavigationEventArgs.cs
- RadioButtonPopupAdapter.cs
- ColorContextHelper.cs
- Container.cs
- PackagingUtilities.cs
- ChannelServices.cs
- HashMembershipCondition.cs
- XmlDataCollection.cs
- Parameter.cs
- ToolStripItemImageRenderEventArgs.cs
- GraphicsState.cs
- MembershipValidatePasswordEventArgs.cs
- BindToObject.cs
- TypeSystem.cs
- CompiledRegexRunnerFactory.cs
- HtmlTextArea.cs
- ListBoxItemWrapperAutomationPeer.cs
- UICuesEvent.cs
- EncryptedPackage.cs
- SafeCertificateStore.cs
- DataGridRowHeader.cs
- ErrorFormatter.cs
- StorageAssociationTypeMapping.cs
- DPCustomTypeDescriptor.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- MethodImplAttribute.cs
- TreeIterator.cs
- RtType.cs
- SecurityKeyUsage.cs
- HttpListenerResponse.cs
- FileAuthorizationModule.cs
- WorkflowViewElement.cs
- ObjectIDGenerator.cs
- MachineSettingsSection.cs
- MSAAWinEventWrap.cs
- XMLSchema.cs
- isolationinterop.cs
- COM2Enum.cs
- JsonWriter.cs
- PassportAuthentication.cs
- PathFigureCollectionValueSerializer.cs
- ToolStripGrip.cs
- SafeNativeMethods.cs
- RequestCacheEntry.cs
- MissingSatelliteAssemblyException.cs
- SqlTrackingQuery.cs
- brushes.cs
- PageCache.cs
- TreeViewItem.cs
- WorkflowQueueInfo.cs
- OleDbWrapper.cs
- TypeHelpers.cs
- LinqDataSourceContextEventArgs.cs
- DynamicResourceExtensionConverter.cs
- _Events.cs
- ManifestResourceInfo.cs
- SqlBulkCopyColumnMapping.cs
- Object.cs
- AutomationPatternInfo.cs
- IsolatedStorageFile.cs
- PropertyPath.cs
- WeakReference.cs
- SRGSCompiler.cs
- RadioButton.cs
- CharacterBuffer.cs
- StatusBar.cs
- BitArray.cs
- SelectionHighlightInfo.cs
- BooleanStorage.cs
- PreloadedPackages.cs
- Object.cs
- HttpApplicationFactory.cs
- EncryptedData.cs
- _UncName.cs
- ConsumerConnectionPointCollection.cs
- AttributeCollection.cs
- Margins.cs
- UnauthorizedAccessException.cs
- StaticResourceExtension.cs
- DoubleCollection.cs
- ColorConverter.cs
- TextServicesCompartmentContext.cs
- BitmapFrameEncode.cs
- TrustLevel.cs
- TreeNodeStyleCollection.cs
- PrivilegeNotHeldException.cs
- PointValueSerializer.cs
- QilDataSource.cs
- SchemaDeclBase.cs
- DataGridCellAutomationPeer.cs
- PropertyGridEditorPart.cs
- TextEditorTables.cs