Code:
/ FX-1434 / FX-1434 / 1.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
- ToolStripHighContrastRenderer.cs
- SqlUtils.cs
- SelfIssuedSamlTokenFactory.cs
- ParenthesizePropertyNameAttribute.cs
- EncoderParameters.cs
- XPathConvert.cs
- EndpointAddressProcessor.cs
- CatalogUtil.cs
- MessageSecurityVersionConverter.cs
- CodeConditionStatement.cs
- RequestQueue.cs
- NativeMethods.cs
- SystemNetHelpers.cs
- BufferedStream.cs
- PointAnimationUsingPath.cs
- TextParaLineResult.cs
- ObsoleteAttribute.cs
- SimpleWebHandlerParser.cs
- WindowsTokenRoleProvider.cs
- SoapHelper.cs
- Win32Native.cs
- GroupBox.cs
- CodeGeneratorAttribute.cs
- EdmValidator.cs
- CollectionView.cs
- SelectionList.cs
- SafeNativeHandle.cs
- DocumentPage.cs
- ListViewItem.cs
- XsdDateTime.cs
- CommonObjectSecurity.cs
- DataColumnSelectionConverter.cs
- InvariantComparer.cs
- FloaterParaClient.cs
- TextProperties.cs
- IteratorFilter.cs
- ReaderWriterLock.cs
- serverconfig.cs
- IApplicationTrustManager.cs
- SafeHandles.cs
- OutputBuffer.cs
- CallContext.cs
- SizeAnimationClockResource.cs
- EventBuilder.cs
- InstalledVoice.cs
- ValidationErrorCollection.cs
- ManagementObjectSearcher.cs
- ValidationPropertyAttribute.cs
- ValidatorCompatibilityHelper.cs
- WebPartConnectionsCancelVerb.cs
- ConfigurationCollectionAttribute.cs
- AlternateView.cs
- TextReader.cs
- ToolStripItemClickedEventArgs.cs
- SettingsSavedEventArgs.cs
- Point3DAnimation.cs
- log.cs
- CompositionAdorner.cs
- SspiNegotiationTokenProvider.cs
- MatrixAnimationUsingKeyFrames.cs
- WebBrowserBase.cs
- ValidationEventArgs.cs
- XmlBinaryReaderSession.cs
- AudienceUriMode.cs
- DesignerSerializerAttribute.cs
- DeclarativeCatalogPartDesigner.cs
- InkCanvasFeedbackAdorner.cs
- Marshal.cs
- BufferedGraphicsManager.cs
- LiteralControl.cs
- Context.cs
- View.cs
- SchemaComplexType.cs
- Menu.cs
- BindingNavigator.cs
- WebPageTraceListener.cs
- RijndaelManagedTransform.cs
- Annotation.cs
- EntityContainer.cs
- SelfIssuedAuthRSAPKCS1SignatureFormatter.cs
- XmlCodeExporter.cs
- ZipQueryOperator.cs
- BodyGlyph.cs
- SamlAssertion.cs
- CodeArrayIndexerExpression.cs
- EntityDataSourceDesigner.cs
- IRCollection.cs
- PersonalizationStateQuery.cs
- MouseDevice.cs
- ListViewAutomationPeer.cs
- ActivityBuilderHelper.cs
- ScriptComponentDescriptor.cs
- SqlStatistics.cs
- EntityDataSourceState.cs
- ProcessModelSection.cs
- DataConnectionHelper.cs
- TracingConnectionListener.cs
- PassportAuthenticationModule.cs
- AttachInfo.cs
- listitem.cs