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
- Page.cs
- InternalConfigEventArgs.cs
- SimpleBitVector32.cs
- ItemsControl.cs
- Models.cs
- ComboBoxItem.cs
- StringUtil.cs
- AttributeCollection.cs
- XPathDescendantIterator.cs
- JavaScriptSerializer.cs
- StylusDownEventArgs.cs
- TypeSystem.cs
- HttpResponse.cs
- ListViewEditEventArgs.cs
- PermissionListSet.cs
- DashStyle.cs
- FileDialog_Vista.cs
- WebPartVerbsEventArgs.cs
- SchemaMapping.cs
- IIS7UserPrincipal.cs
- KeyTimeConverter.cs
- XmlElementAttribute.cs
- ReadOnlyKeyedCollection.cs
- AssemblyName.cs
- RelationalExpressions.cs
- Renderer.cs
- BitmapFrame.cs
- xmlfixedPageInfo.cs
- WinFormsSpinner.cs
- WeakKeyDictionary.cs
- WebSysDefaultValueAttribute.cs
- HashSetDebugView.cs
- TargetConverter.cs
- WindowsPen.cs
- Nullable.cs
- CompleteWizardStep.cs
- HttpCapabilitiesEvaluator.cs
- ListView.cs
- AdPostCacheSubstitution.cs
- CommandConverter.cs
- TableFieldsEditor.cs
- Track.cs
- HtmlTable.cs
- FastEncoderStatics.cs
- ObjectSpanRewriter.cs
- InstanceNormalEvent.cs
- MemoryFailPoint.cs
- BinaryUtilClasses.cs
- OdbcUtils.cs
- GACIdentityPermission.cs
- SafeNativeMethods.cs
- CommandLibraryHelper.cs
- IDictionary.cs
- ThousandthOfEmRealDoubles.cs
- SolidColorBrush.cs
- GC.cs
- ChildrenQuery.cs
- EventToken.cs
- SystemParameters.cs
- DataSourceView.cs
- StyleTypedPropertyAttribute.cs
- AuthenticationModulesSection.cs
- MdiWindowListItemConverter.cs
- DataServiceExpressionVisitor.cs
- SharedStatics.cs
- GetParentChain.cs
- CommonDialog.cs
- Environment.cs
- VScrollBar.cs
- base64Transforms.cs
- Model3DGroup.cs
- PageThemeParser.cs
- ObsoleteAttribute.cs
- ServiceObjectContainer.cs
- UpdateTranslator.cs
- WithParamAction.cs
- HtmlAnchor.cs
- Frame.cs
- EditorZone.cs
- FormViewDeletedEventArgs.cs
- TextParagraphView.cs
- AlphabeticalEnumConverter.cs
- SqlGenerator.cs
- TableProvider.cs
- EventSinkActivityDesigner.cs
- HttpApplication.cs
- And.cs
- XmlMemberMapping.cs
- WindowInteropHelper.cs
- AdPostCacheSubstitution.cs
- SqlMethodAttribute.cs
- ApplicationException.cs
- PageThemeParser.cs
- DynamicPropertyReader.cs
- SafeThreadHandle.cs
- RightsManagementEncryptedStream.cs
- IndexerNameAttribute.cs
- Cursor.cs
- JapaneseLunisolarCalendar.cs
- DataBindingList.cs