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
- Registry.cs
- RayMeshGeometry3DHitTestResult.cs
- OleAutBinder.cs
- SiteMapPath.cs
- IdentityHolder.cs
- SafeViewOfFileHandle.cs
- ObjectSet.cs
- FieldAccessException.cs
- SID.cs
- DbConnectionPoolCounters.cs
- DataSourceDesigner.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- MemberInfoSerializationHolder.cs
- EntityDataSourceSelectedEventArgs.cs
- DateTimeAutomationPeer.cs
- OletxTransactionFormatter.cs
- XmlTextReaderImpl.cs
- DecoratedNameAttribute.cs
- HyperLinkField.cs
- DataControlCommands.cs
- StylusDevice.cs
- _Connection.cs
- TemplateControlParser.cs
- DependencyObject.cs
- ObjectContext.cs
- storagemappingitemcollection.viewdictionary.cs
- Clipboard.cs
- EventRoute.cs
- XmlChoiceIdentifierAttribute.cs
- RtfControlWordInfo.cs
- FatalException.cs
- DataControlFieldCell.cs
- ConvertersCollection.cs
- StreamInfo.cs
- DrawingImage.cs
- TraceContextRecord.cs
- SemanticResolver.cs
- HostExecutionContextManager.cs
- CryptoApi.cs
- SqlClientPermission.cs
- DataPager.cs
- Scalars.cs
- PageEventArgs.cs
- PageFunction.cs
- HeaderedItemsControl.cs
- dataprotectionpermission.cs
- StaticSiteMapProvider.cs
- AtomServiceDocumentSerializer.cs
- ResumeStoryboard.cs
- WizardSideBarListControlItemEventArgs.cs
- XPathScanner.cs
- DynamicRenderer.cs
- shaper.cs
- FontSourceCollection.cs
- RegexEditorDialog.cs
- DefaultProxySection.cs
- ProtocolsConfigurationHandler.cs
- WorkflowItemPresenter.cs
- SafeRightsManagementQueryHandle.cs
- LoginDesigner.cs
- LocalBuilder.cs
- Timeline.cs
- CssTextWriter.cs
- SparseMemoryStream.cs
- GridView.cs
- BufferedWebEventProvider.cs
- BindingExpressionBase.cs
- WeakReadOnlyCollection.cs
- QilInvokeEarlyBound.cs
- TextContainerChangedEventArgs.cs
- DetailsViewRow.cs
- MatrixTransform3D.cs
- LinkClickEvent.cs
- CatalogPartCollection.cs
- SecurityElement.cs
- CorrelationToken.cs
- BooleanSwitch.cs
- TextBoxAutomationPeer.cs
- XmlMemberMapping.cs
- ArraySegment.cs
- SourceFileBuildProvider.cs
- CmsInterop.cs
- TraceHandler.cs
- MergeFailedEvent.cs
- AddInIpcChannel.cs
- XmlRawWriterWrapper.cs
- TokenBasedSetEnumerator.cs
- AttributeParameterInfo.cs
- RadialGradientBrush.cs
- FormsAuthenticationTicket.cs
- FloatUtil.cs
- Point3DKeyFrameCollection.cs
- FloaterParaClient.cs
- DelegateSerializationHolder.cs
- WeakEventManager.cs
- MbpInfo.cs
- InvalidDataException.cs
- BamlLocalizableResourceKey.cs
- RangeContentEnumerator.cs
- SecurityKeyUsage.cs