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
- ApplicationInfo.cs
- FormsAuthentication.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- OleDbRowUpdatedEvent.cs
- SqlBulkCopyColumnMapping.cs
- SchemaComplexType.cs
- FamilyMap.cs
- Adorner.cs
- DefaultSerializationProviderAttribute.cs
- ButtonColumn.cs
- MatrixUtil.cs
- SessionStateSection.cs
- XmlDomTextWriter.cs
- JsonFormatWriterGenerator.cs
- RelationshipEntry.cs
- TransformationRules.cs
- WizardPanelChangingEventArgs.cs
- HuffmanTree.cs
- StatusBarAutomationPeer.cs
- base64Transforms.cs
- XmlSchemaValidator.cs
- TextFindEngine.cs
- HtmlContainerControl.cs
- ItemType.cs
- Cursor.cs
- DiffuseMaterial.cs
- HtmlTextArea.cs
- FileLevelControlBuilderAttribute.cs
- OrderedHashRepartitionStream.cs
- DataView.cs
- TextComposition.cs
- PerformanceCounter.cs
- XsdValidatingReader.cs
- _CommandStream.cs
- X509Certificate.cs
- ToolStripSettings.cs
- OleDbCommand.cs
- LinkedResourceCollection.cs
- XmlStringTable.cs
- ObjectItemCollection.cs
- PathFigure.cs
- Int64AnimationUsingKeyFrames.cs
- BitmapEffectOutputConnector.cs
- Menu.cs
- HandleExceptionArgs.cs
- NodeFunctions.cs
- URL.cs
- EntityTypeBase.cs
- LinkClickEvent.cs
- StylusPointProperties.cs
- BuildProvider.cs
- HttpSessionStateBase.cs
- TextRunCache.cs
- PropertyMap.cs
- Misc.cs
- RemoteWebConfigurationHostStream.cs
- WebPartConnectionsCancelEventArgs.cs
- ReferencedType.cs
- XmlSchemaSimpleContent.cs
- StateBag.cs
- ExpandSegmentCollection.cs
- FrameworkObject.cs
- CachedFontFamily.cs
- WindowsAuthenticationEventArgs.cs
- Evaluator.cs
- MimeBasePart.cs
- _NestedMultipleAsyncResult.cs
- BulletChrome.cs
- HtmlHistory.cs
- ComponentManagerBroker.cs
- JournalEntryListConverter.cs
- HtmlTextArea.cs
- PanelStyle.cs
- Parameter.cs
- LineSegment.cs
- ObjectHelper.cs
- _HelperAsyncResults.cs
- ArrangedElement.cs
- EventDescriptor.cs
- DependencyPropertyHelper.cs
- AvTraceDetails.cs
- NetworkInformationException.cs
- DataBinding.cs
- ForwardPositionQuery.cs
- DataServiceQueryException.cs
- ExclusiveHandleList.cs
- BulletDecorator.cs
- BitmapVisualManager.cs
- ElementsClipboardData.cs
- DbProviderConfigurationHandler.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- AddInProcess.cs
- PassportAuthentication.cs
- GlyphsSerializer.cs
- SQLBinaryStorage.cs
- GatewayIPAddressInformationCollection.cs
- IssuerInformation.cs
- _IPv6Address.cs
- ComponentCollection.cs
- SafeFileHandle.cs