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
- EntityClientCacheEntry.cs
- WebEvents.cs
- OleDbParameterCollection.cs
- EncodingInfo.cs
- TypeHelpers.cs
- DataKeyArray.cs
- MarkupProperty.cs
- _CookieModule.cs
- BamlStream.cs
- CacheDependency.cs
- FormViewCommandEventArgs.cs
- CompositionAdorner.cs
- Imaging.cs
- Cursor.cs
- Column.cs
- BamlMapTable.cs
- sqlstateclientmanager.cs
- TableCellAutomationPeer.cs
- PointIndependentAnimationStorage.cs
- WebExceptionStatus.cs
- TextSimpleMarkerProperties.cs
- ConfigXmlElement.cs
- WeakEventManager.cs
- CompositionAdorner.cs
- FontEmbeddingManager.cs
- DrawingDrawingContext.cs
- WindowsComboBox.cs
- AbsoluteQuery.cs
- PackWebRequestFactory.cs
- CreateUserWizardStep.cs
- StreamReader.cs
- OleDbConnectionInternal.cs
- baseshape.cs
- EpmSourceTree.cs
- MobileListItem.cs
- CreateParams.cs
- SecurityDescriptor.cs
- DataShape.cs
- connectionpool.cs
- METAHEADER.cs
- EnumValAlphaComparer.cs
- DurableEnlistmentState.cs
- ApplicationProxyInternal.cs
- IntAverageAggregationOperator.cs
- DesignTimeParseData.cs
- DynamicDataManager.cs
- TextReader.cs
- ButtonField.cs
- NetworkStream.cs
- AttachedPropertyMethodSelector.cs
- QilName.cs
- DataGridTextBoxColumn.cs
- XpsSerializerWriter.cs
- CodeStatementCollection.cs
- Convert.cs
- RuntimeArgumentHandle.cs
- WebServiceMethodData.cs
- CompilationUtil.cs
- WindowManager.cs
- CompoundFileStorageReference.cs
- entityreference_tresulttype.cs
- ArcSegment.cs
- ProfileGroupSettings.cs
- TargetException.cs
- GridViewSelectEventArgs.cs
- XamlStackWriter.cs
- ContourSegment.cs
- ImageListStreamer.cs
- HttpCookiesSection.cs
- XPathExpr.cs
- PageWrapper.cs
- UriWriter.cs
- FontResourceCache.cs
- TabletDevice.cs
- WpfXamlLoader.cs
- ImageDrawing.cs
- PersistencePipeline.cs
- DBConnectionString.cs
- BindingUtils.cs
- RSAPKCS1SignatureFormatter.cs
- SqlDataSourceQueryEditorForm.cs
- TailPinnedEventArgs.cs
- AmbiguousMatchException.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- odbcmetadatacolumnnames.cs
- SqlUnionizer.cs
- AutomationIdentifierGuids.cs
- RunInstallerAttribute.cs
- AccessDataSourceWizardForm.cs
- LassoHelper.cs
- WorkflowRuntimeEndpoint.cs
- PassportAuthenticationEventArgs.cs
- UnauthorizedWebPart.cs
- InputLanguage.cs
- SplitContainerDesigner.cs
- NativeObjectSecurity.cs
- Hyperlink.cs
- CookieParameter.cs
- SqlCrossApplyToCrossJoin.cs
- Localizer.cs