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
- TextRangeAdaptor.cs
- InputBindingCollection.cs
- ListBoxDesigner.cs
- MaskedTextProvider.cs
- HiddenField.cs
- EntityException.cs
- BamlCollectionHolder.cs
- FixUp.cs
- SqlReferenceCollection.cs
- TextSpan.cs
- TcpStreams.cs
- SerializationInfo.cs
- LayoutEditorPart.cs
- FileDialogCustomPlaces.cs
- Vector3DIndependentAnimationStorage.cs
- DashStyle.cs
- TransformedBitmap.cs
- TogglePatternIdentifiers.cs
- SignatureDescription.cs
- Util.cs
- KeyValuePairs.cs
- AlphabeticalEnumConverter.cs
- DoubleCollectionConverter.cs
- ComplusEndpointConfigContainer.cs
- OleDbCommandBuilder.cs
- ProviderUtil.cs
- BaseParser.cs
- RandomNumberGenerator.cs
- OdbcHandle.cs
- Propagator.JoinPropagator.cs
- WorkflowDefinitionDispenser.cs
- OleDbReferenceCollection.cs
- StylusPointPropertyId.cs
- ObjectStorage.cs
- RotateTransform3D.cs
- SchemaObjectWriter.cs
- TimeoutHelper.cs
- SoapHeader.cs
- SpellerInterop.cs
- Animatable.cs
- Dump.cs
- ObjectStateManagerMetadata.cs
- DecodeHelper.cs
- ColorDialog.cs
- ObfuscationAttribute.cs
- ConfigXmlSignificantWhitespace.cs
- CharKeyFrameCollection.cs
- AsyncCompletedEventArgs.cs
- HashStream.cs
- KeyBinding.cs
- DataGridSortCommandEventArgs.cs
- RectangleF.cs
- StrongNameMembershipCondition.cs
- CompilerInfo.cs
- CodeValidator.cs
- Debug.cs
- _UriSyntax.cs
- TextEditorLists.cs
- CircleHotSpot.cs
- VarRefManager.cs
- Clock.cs
- VScrollBar.cs
- WinInet.cs
- InstrumentationTracker.cs
- FlowLayout.cs
- BooleanExpr.cs
- SecurityToken.cs
- VersionedStream.cs
- Rss20FeedFormatter.cs
- EdmTypeAttribute.cs
- AmbientValueAttribute.cs
- ManifestBasedResourceGroveler.cs
- DesignerCategoryAttribute.cs
- Msec.cs
- HorizontalAlignConverter.cs
- Graph.cs
- TextElementEnumerator.cs
- TextTreeDeleteContentUndoUnit.cs
- ObjectListGeneralPage.cs
- PerformanceCounterPermissionEntryCollection.cs
- _NtlmClient.cs
- MonitorWrapper.cs
- CurrencyWrapper.cs
- TextFormatterContext.cs
- ResourceProperty.cs
- TransformedBitmap.cs
- UrlPath.cs
- CodeVariableDeclarationStatement.cs
- FramingDecoders.cs
- CompatibleIComparer.cs
- TableItemPattern.cs
- ObsoleteAttribute.cs
- GridItem.cs
- CompositeFontParser.cs
- UInt64.cs
- VirtualDirectoryMappingCollection.cs
- SmiMetaDataProperty.cs
- X509WindowsSecurityToken.cs
- Condition.cs
- OdbcRowUpdatingEvent.cs