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
- DbgUtil.cs
- SelectionService.cs
- NativeMethods.cs
- DataBindingCollectionEditor.cs
- ExternalException.cs
- SqlVisitor.cs
- FastPropertyAccessor.cs
- HttpListener.cs
- LostFocusEventManager.cs
- SamlAssertionKeyIdentifierClause.cs
- HttpsTransportElement.cs
- SimpleHandlerFactory.cs
- NetworkStream.cs
- ResourcePart.cs
- Panel.cs
- SecuritySessionFilter.cs
- XmlDocument.cs
- RuleInfoComparer.cs
- AutoGeneratedField.cs
- CheckBoxStandardAdapter.cs
- ExpandSegment.cs
- PageCodeDomTreeGenerator.cs
- ResourceManagerWrapper.cs
- TextServicesCompartmentContext.cs
- CategoryGridEntry.cs
- ExceptionRoutedEventArgs.cs
- RouteParametersHelper.cs
- SqlCommandAsyncResult.cs
- RotateTransform3D.cs
- Point3D.cs
- TextureBrush.cs
- EventPropertyMap.cs
- XmlAttributeCollection.cs
- ChildDocumentBlock.cs
- HotSpotCollectionEditor.cs
- FixedLineResult.cs
- LogSwitch.cs
- TextTreeInsertUndoUnit.cs
- WebResourceAttribute.cs
- SQLInt16.cs
- _HeaderInfoTable.cs
- EventNotify.cs
- BindingBase.cs
- OleDbMetaDataFactory.cs
- EnvironmentPermission.cs
- WindowPattern.cs
- FaultHandlingFilter.cs
- KeyPullup.cs
- Vector3DAnimation.cs
- Int64Storage.cs
- Region.cs
- LinqDataSourceHelper.cs
- WebPartConnectVerb.cs
- CollectionEditorDialog.cs
- HashJoinQueryOperatorEnumerator.cs
- ObjectSet.cs
- EncoderBestFitFallback.cs
- TimeSpanStorage.cs
- IsolatedStorageException.cs
- HttpErrorTraceRecord.cs
- ValueTypeFixupInfo.cs
- NavigationProperty.cs
- SrgsGrammar.cs
- SqlMultiplexer.cs
- PrimitiveType.cs
- TemplateApplicationHelper.cs
- RemotingSurrogateSelector.cs
- CollectionViewSource.cs
- Pen.cs
- PageScaling.cs
- AlternateViewCollection.cs
- ProviderCollection.cs
- HttpModuleActionCollection.cs
- ParallelRangeManager.cs
- ObjectQuery.cs
- Point3DAnimationBase.cs
- StateItem.cs
- LineServices.cs
- LinkDesigner.cs
- LogWriteRestartAreaState.cs
- HtmlProps.cs
- XslCompiledTransform.cs
- SoapSchemaMember.cs
- SHA384CryptoServiceProvider.cs
- SchemaName.cs
- DictionarySectionHandler.cs
- ResponseStream.cs
- OperationPerformanceCounters.cs
- ImageDrawing.cs
- XsltLoader.cs
- SplitterCancelEvent.cs
- XmlStringTable.cs
- HttpClientCertificate.cs
- ToolboxDataAttribute.cs
- ListBindableAttribute.cs
- WebBrowserPermission.cs
- WebPartHeaderCloseVerb.cs
- WebPartZoneAutoFormat.cs
- SizeAnimationClockResource.cs
- NonParentingControl.cs