Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Ticks.cs
- SymbolUsageManager.cs
- PlatformNotSupportedException.cs
- RowTypeElement.cs
- SortFieldComparer.cs
- RequestCache.cs
- COM2ExtendedUITypeEditor.cs
- ComUdtElement.cs
- MultiPropertyDescriptorGridEntry.cs
- ThrowHelper.cs
- CryptoKeySecurity.cs
- ResourceAttributes.cs
- CheckBox.cs
- DbConnectionPool.cs
- ImageListStreamer.cs
- RoleManagerSection.cs
- TypeDependencyAttribute.cs
- NamespaceInfo.cs
- DataBoundControlAdapter.cs
- XmlUtil.cs
- RecordsAffectedEventArgs.cs
- ToolConsole.cs
- AppDomain.cs
- FileRecordSequence.cs
- WindowsListBox.cs
- OleDbMetaDataFactory.cs
- _DisconnectOverlappedAsyncResult.cs
- MsmqEncryptionAlgorithm.cs
- CounterSample.cs
- ListViewItem.cs
- WebPartConnectionsConnectVerb.cs
- ActiveXHelper.cs
- Boolean.cs
- GroupStyle.cs
- GenerateTemporaryTargetAssembly.cs
- StrokeNodeOperations2.cs
- CloseSequenceResponse.cs
- Win32.cs
- InfiniteTimeSpanConverter.cs
- KnownBoxes.cs
- DataObjectCopyingEventArgs.cs
- ping.cs
- SQLMoney.cs
- GlyphRunDrawing.cs
- SingleKeyFrameCollection.cs
- FileNotFoundException.cs
- TextServicesPropertyRanges.cs
- OwnerDrawPropertyBag.cs
- ISCIIEncoding.cs
- CmsInterop.cs
- Rules.cs
- MouseActionConverter.cs
- NestedContainer.cs
- XmlNamespaceDeclarationsAttribute.cs
- MatrixStack.cs
- TableLayoutPanelDesigner.cs
- ExtendedProperty.cs
- DecoderFallbackWithFailureFlag.cs
- DropShadowBitmapEffect.cs
- CursorEditor.cs
- FormsAuthenticationCredentials.cs
- ThreadStateException.cs
- _CookieModule.cs
- DemultiplexingClientMessageFormatter.cs
- KeyInstance.cs
- ScriptHandlerFactory.cs
- exports.cs
- TextEffectCollection.cs
- ListBoxDesigner.cs
- SchemaComplexType.cs
- ToolStripStatusLabel.cs
- SessionParameter.cs
- CalendarDesigner.cs
- MemberDescriptor.cs
- BinaryParser.cs
- DummyDataSource.cs
- SQLRoleProvider.cs
- MsmqAuthenticationMode.cs
- RawMouseInputReport.cs
- ConnectionProviderAttribute.cs
- NullReferenceException.cs
- ClipboardProcessor.cs
- BCryptNative.cs
- ConfigurationManagerHelper.cs
- SqlSelectStatement.cs
- ObjectSpanRewriter.cs
- MobileUserControlDesigner.cs
- Site.cs
- UIElement3DAutomationPeer.cs
- TextServicesPropertyRanges.cs
- SettingsAttributes.cs
- SafeNativeMethods.cs
- RecordManager.cs
- OptimizedTemplateContentHelper.cs
- Queue.cs
- DataTableMapping.cs
- PagerStyle.cs
- SqlClientWrapperSmiStreamChars.cs
- XmlTextReader.cs
- EntityContainerRelationshipSetEnd.cs