Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Cryptography / MD5CryptoServiceProvider.cs / 1305376 / MD5CryptoServiceProvider.cs
using System.Diagnostics.Contracts; // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //[....] // // // MD5CryptoServiceProvider.cs // namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public sealed class MD5CryptoServiceProvider : MD5 { [System.Security.SecurityCritical /*auto-generated*/] private SafeHashHandle _safeHashHandle = null; // // public constructors // [System.Security.SecuritySafeCritical] // auto-generated public MD5CryptoServiceProvider() { if (CryptoConfig.AllowOnlyFipsAlgorithms) throw new InvalidOperationException(Environment.GetResourceString("Cryptography_NonCompliantFIPSAlgorithm")); Contract.EndContractBlock(); // _CreateHash will check for failures and throw the appropriate exception _safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_MD5); } [System.Security.SecuritySafeCritical] // overrides public transparent member protected override void Dispose(bool disposing) { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); base.Dispose(disposing); } // // public methods // [System.Security.SecuritySafeCritical] // auto-generated public override void Initialize() { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); // _CreateHash will check for failures and throw the appropriate exception _safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_MD5); } [System.Security.SecuritySafeCritical] // overrides protected transparent member protected override void HashCore(byte[] rgb, int ibStart, int cbSize) { Utils.HashData(_safeHashHandle, rgb, ibStart, cbSize); } [System.Security.SecuritySafeCritical] // overrides protected transparent member protected override byte[] HashFinal() { return Utils.EndHash(_safeHashHandle); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlFormatter.cs
- ControlParameter.cs
- DesignTimeData.cs
- CompareInfo.cs
- ImplicitInputBrush.cs
- VirtualizingStackPanel.cs
- RegexRunnerFactory.cs
- TypeDescriptionProvider.cs
- ProcessModelInfo.cs
- PEFileReader.cs
- BindMarkupExtensionSerializer.cs
- DocumentOrderComparer.cs
- ImageDrawing.cs
- ResourcePool.cs
- EventLogPermissionEntry.cs
- DocumentGridContextMenu.cs
- TextPointerBase.cs
- DataFormats.cs
- FreeFormDesigner.cs
- MethodCallConverter.cs
- WebServiceMethodData.cs
- EntityContainer.cs
- ApplicationSecurityInfo.cs
- StructuralType.cs
- CookieParameter.cs
- Config.cs
- DataGridCell.cs
- Image.cs
- PackageProperties.cs
- PerformanceCounterCategory.cs
- GestureRecognizer.cs
- TableLayoutColumnStyleCollection.cs
- ListViewUpdatedEventArgs.cs
- ReflectionPermission.cs
- DataGridViewImageCell.cs
- DrawListViewItemEventArgs.cs
- GradientStopCollection.cs
- SharedUtils.cs
- _SslSessionsCache.cs
- SQLByte.cs
- VoiceInfo.cs
- ColumnMap.cs
- FontStretchConverter.cs
- ScrollItemPatternIdentifiers.cs
- WebPartZoneBase.cs
- TextEditorThreadLocalStore.cs
- GenericUI.cs
- TabletDevice.cs
- Action.cs
- DataBoundControl.cs
- FormatterConverter.cs
- StringReader.cs
- SecurityDocument.cs
- SetterTriggerConditionValueConverter.cs
- X509CertificateInitiatorServiceCredential.cs
- WindowsNonControl.cs
- EntityParameter.cs
- ApplyTemplatesAction.cs
- SerialPinChanges.cs
- cookieexception.cs
- PermissionSetEnumerator.cs
- RegistryExceptionHelper.cs
- ReversePositionQuery.cs
- ResourcesBuildProvider.cs
- RegexRunnerFactory.cs
- CheckableControlBaseAdapter.cs
- WindowsListViewSubItem.cs
- FragmentQueryKB.cs
- OrderedDictionaryStateHelper.cs
- ReadOnlyDataSourceView.cs
- TextTreePropertyUndoUnit.cs
- DbMetaDataCollectionNames.cs
- ContainerParaClient.cs
- LinqDataSourceDisposeEventArgs.cs
- EntityDataSourceContextDisposingEventArgs.cs
- isolationinterop.cs
- LoginUtil.cs
- Function.cs
- PromptBuilder.cs
- DrawingGroup.cs
- QueryReaderSettings.cs
- TextDecorationCollection.cs
- ObjectConverter.cs
- EdmProviderManifest.cs
- BitmapEffectDrawingContextWalker.cs
- MimePart.cs
- SynchronizedPool.cs
- DataContract.cs
- TranslateTransform3D.cs
- ProcessHostFactoryHelper.cs
- EdmProperty.cs
- DateTimeSerializationSection.cs
- SemaphoreFullException.cs
- SoapTypeAttribute.cs
- ContentElementAutomationPeer.cs
- MergeFailedEvent.cs
- UserNamePasswordServiceCredential.cs
- ImmutableDispatchRuntime.cs
- PropertyGridEditorPart.cs
- FloaterParagraph.cs