Code:
/ 4.0 / 4.0 / 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. 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
- EntitySqlQueryCacheKey.cs
- TextServicesDisplayAttributePropertyRanges.cs
- ToolStripPanelRow.cs
- AutomationPeer.cs
- StreamedFramingRequestChannel.cs
- RoleServiceManager.cs
- SizeAnimationBase.cs
- BinaryUtilClasses.cs
- COM2ComponentEditor.cs
- Region.cs
- TreeNodeEventArgs.cs
- ProfileServiceManager.cs
- AsyncDataRequest.cs
- EmbeddedObject.cs
- MultipleCopiesCollection.cs
- TripleDES.cs
- SecurityPermission.cs
- DataRecord.cs
- FixedSOMElement.cs
- PreviewPrintController.cs
- GridViewColumnHeaderAutomationPeer.cs
- _NativeSSPI.cs
- Registry.cs
- FormViewUpdatedEventArgs.cs
- DataColumnPropertyDescriptor.cs
- RichTextBox.cs
- VersionPair.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- ModelUIElement3D.cs
- PropertyChangedEventManager.cs
- Identity.cs
- TraceContextEventArgs.cs
- FtpWebResponse.cs
- LambdaCompiler.Logical.cs
- SecureConversationDriver.cs
- SafeNativeMethods.cs
- UnmanagedMemoryStreamWrapper.cs
- XPathEmptyIterator.cs
- DataTableExtensions.cs
- SystemDropShadowChrome.cs
- AutomationPatternInfo.cs
- SystemWebSectionGroup.cs
- NumericUpDownAcceleration.cs
- HotSpotCollection.cs
- RichTextBoxConstants.cs
- SystemFonts.cs
- XhtmlBasicTextBoxAdapter.cs
- UniqueIdentifierService.cs
- OdbcReferenceCollection.cs
- XmlMessageFormatter.cs
- DataContractAttribute.cs
- CustomWebEventKey.cs
- RtfToXamlReader.cs
- FontWeights.cs
- ClientConvert.cs
- DataKeyCollection.cs
- UriWriter.cs
- OutKeywords.cs
- HostProtectionPermission.cs
- Error.cs
- ListControl.cs
- ScriptReferenceEventArgs.cs
- Psha1DerivedKeyGeneratorHelper.cs
- SQLBinary.cs
- XmlWriterDelegator.cs
- StatusBarDesigner.cs
- ToolStripOverflow.cs
- HttpWebRequestElement.cs
- PeerObject.cs
- Odbc32.cs
- NonSerializedAttribute.cs
- TemplateBuilder.cs
- ExpressionNode.cs
- ClientBuildManager.cs
- XmlSchemaSimpleContent.cs
- SrgsSubset.cs
- LinearGradientBrush.cs
- MSG.cs
- JapaneseLunisolarCalendar.cs
- EntityDesignerUtils.cs
- SafeViewOfFileHandle.cs
- TypeElementCollection.cs
- parserscommon.cs
- FormatterServices.cs
- InputBuffer.cs
- RadioButtonFlatAdapter.cs
- configsystem.cs
- XmlHierarchyData.cs
- XmlSchemaSimpleTypeList.cs
- DataTemplate.cs
- InputScopeConverter.cs
- RadioButtonBaseAdapter.cs
- TypedAsyncResult.cs
- MethodToken.cs
- ProviderBase.cs
- RectangleConverter.cs
- XmlToDatasetMap.cs
- CodeArrayIndexerExpression.cs
- COSERVERINFO.cs
- Point4DValueSerializer.cs