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
- MetadataWorkspace.cs
- DbCommandDefinition.cs
- ZipIOLocalFileBlock.cs
- XmlResolver.cs
- ObjectTypeMapping.cs
- SqlErrorCollection.cs
- ListViewSelectEventArgs.cs
- Bidi.cs
- ExpandableObjectConverter.cs
- StyleSheetDesigner.cs
- UnsafeNativeMethodsCLR.cs
- CommentEmitter.cs
- CapabilitiesState.cs
- ActivityBindForm.cs
- followingsibling.cs
- StandardToolWindows.cs
- WebReference.cs
- HtmlInputSubmit.cs
- TraceHandlerErrorFormatter.cs
- CollectionEditVerbManager.cs
- SqlConnectionStringBuilder.cs
- MatrixUtil.cs
- DataGridAutoFormat.cs
- AdministrationHelpers.cs
- XmlValidatingReader.cs
- HtmlMeta.cs
- SpellerHighlightLayer.cs
- M3DUtil.cs
- CompilerInfo.cs
- XmlDeclaration.cs
- DependencyPropertyKey.cs
- Renderer.cs
- Dictionary.cs
- DecimalAnimationBase.cs
- BigInt.cs
- GridViewUpdatedEventArgs.cs
- SamlEvidence.cs
- TextEditorCharacters.cs
- ProtocolsConfigurationEntry.cs
- DataServiceClientException.cs
- ScriptManager.cs
- PageCatalogPartDesigner.cs
- CodeGeneratorOptions.cs
- Command.cs
- ChangeToolStripParentVerb.cs
- XmlSerializerSection.cs
- SoapExtensionTypeElementCollection.cs
- SQLMoney.cs
- TextTabProperties.cs
- SimpleNameService.cs
- X509InitiatorCertificateServiceElement.cs
- SessionStateModule.cs
- HttpCachePolicyElement.cs
- StickyNoteHelper.cs
- AxisAngleRotation3D.cs
- ToolStripManager.cs
- ElapsedEventArgs.cs
- StringResourceManager.cs
- StoreItemCollection.Loader.cs
- PropertyToken.cs
- login.cs
- UnmanagedHandle.cs
- AuthorizationRule.cs
- WindowsGraphicsWrapper.cs
- ResolveDuplexAsyncResult.cs
- TwoPhaseCommit.cs
- HeaderUtility.cs
- DrawingCollection.cs
- DoubleAnimationClockResource.cs
- TextEndOfLine.cs
- TextDecoration.cs
- TextSchema.cs
- InstanceData.cs
- Icon.cs
- FixedStringLookup.cs
- DataGridViewRowHeaderCell.cs
- COM2ComponentEditor.cs
- ReturnType.cs
- X509Certificate2Collection.cs
- RotateTransform.cs
- AvTraceFormat.cs
- SqlResolver.cs
- XPathSingletonIterator.cs
- DeviceSpecificChoiceCollection.cs
- DataColumnChangeEvent.cs
- HostProtectionPermission.cs
- DataGridPageChangedEventArgs.cs
- SkipStoryboardToFill.cs
- xsdvalidator.cs
- ApplicationException.cs
- PenContext.cs
- ScriptingWebServicesSectionGroup.cs
- DataMember.cs
- Profiler.cs
- ToolBarOverflowPanel.cs
- ParseHttpDate.cs
- SqlEnums.cs
- DataGridViewAccessibleObject.cs
- TaskFactory.cs
- RegisteredHiddenField.cs