Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- URIFormatException.cs
- AccessDataSourceView.cs
- ScriptReference.cs
- WebPartExportVerb.cs
- assertwrapper.cs
- Point.cs
- StyleCollection.cs
- ExpanderAutomationPeer.cs
- SymbolTable.cs
- MainMenu.cs
- Int32Rect.cs
- DictionaryItemsCollection.cs
- RawStylusActions.cs
- MonthChangedEventArgs.cs
- IntersectQueryOperator.cs
- Helper.cs
- Resources.Designer.cs
- PersonalizationProviderCollection.cs
- RectIndependentAnimationStorage.cs
- PromptStyle.cs
- DataGridCellEditEndingEventArgs.cs
- QilTargetType.cs
- AsyncContentLoadedEventArgs.cs
- OdbcReferenceCollection.cs
- BitmapEffectInputData.cs
- SecurityTokenTypes.cs
- ColumnCollection.cs
- LocationUpdates.cs
- TemplatePropertyEntry.cs
- XmlChildEnumerator.cs
- XsltArgumentList.cs
- PixelFormatConverter.cs
- SqlOuterApplyReducer.cs
- ProbeDuplexCD1AsyncResult.cs
- CurrencyWrapper.cs
- HierarchicalDataBoundControl.cs
- CuspData.cs
- DirectoryNotFoundException.cs
- TextEditorCharacters.cs
- CreateSequence.cs
- ToolStripSettings.cs
- TextPointer.cs
- DataGridCell.cs
- DockingAttribute.cs
- processwaithandle.cs
- PointKeyFrameCollection.cs
- XmlSerializerAssemblyAttribute.cs
- StronglyTypedResourceBuilder.cs
- QilFunction.cs
- ListViewGroupConverter.cs
- Point3DCollection.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- VerticalAlignConverter.cs
- Light.cs
- EventLogPermissionAttribute.cs
- NamespaceDecl.cs
- EmptyEnumerable.cs
- NumericUpDown.cs
- MinimizableAttributeTypeConverter.cs
- SpellerStatusTable.cs
- StylusButton.cs
- ExpressionCopier.cs
- RoutingConfiguration.cs
- TextElementEditingBehaviorAttribute.cs
- StateRuntime.cs
- _ServiceNameStore.cs
- TableRowCollection.cs
- CultureTableRecord.cs
- SchemaEntity.cs
- SrgsElementFactory.cs
- shaperfactory.cs
- NonBatchDirectoryCompiler.cs
- returneventsaver.cs
- WindowsListViewGroupSubsetLink.cs
- WhitespaceRule.cs
- DetailsViewDeleteEventArgs.cs
- AssemblyNameProxy.cs
- TagPrefixAttribute.cs
- Script.cs
- ControlValuePropertyAttribute.cs
- SqlException.cs
- PositiveTimeSpanValidator.cs
- ListBox.cs
- TypeUtil.cs
- DataGridViewColumn.cs
- COM2ExtendedBrowsingHandler.cs
- Transform3D.cs
- TextRangeSerialization.cs
- MenuItemStyle.cs
- OleDbException.cs
- DependencyPropertyHelper.cs
- Material.cs
- ComponentDispatcher.cs
- HostProtectionPermission.cs
- AttributeUsageAttribute.cs
- ToolStripItemImageRenderEventArgs.cs
- SoapIgnoreAttribute.cs
- ResourceAttributes.cs
- XPathDescendantIterator.cs
- ImageConverter.cs