Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Security / Cryptography / MD5Cng.cs / 1305376 / MD5Cng.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== using System; using System.Diagnostics.Contracts; namespace System.Security.Cryptography { ////// Wrapper around the BCrypt implementation of the MD5 hashing algorithm /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class MD5Cng : MD5 { private BCryptHashAlgorithm m_hashAlgorithm; //// [System.Security.SecurityCritical] public MD5Cng() { Contract.Ensures(m_hashAlgorithm != null); if (CryptoConfig.AllowOnlyFipsAlgorithms) { throw new InvalidOperationException(SR.GetString(SR.Cryptography_NonCompliantFIPSAlgorithm)); } m_hashAlgorithm = new BCryptHashAlgorithm(CngAlgorithm.MD5, BCryptNative.ProviderName.MicrosoftPrimitiveProvider); } //// // [System.Security.SecurityCritical] protected override void Dispose(bool disposing) { try { if (disposing) { m_hashAlgorithm.Dispose(); } } finally { base.Dispose(disposing); } } //// // [System.Security.SecurityCritical] public override void Initialize() { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.Initialize(); } //// // [System.Security.SecurityCritical] protected override void HashCore(byte[] array, int ibStart, int cbSize) { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.HashCore(array, ibStart, cbSize); } //// // [System.Security.SecurityCritical] protected override byte[] HashFinal() { Contract.Assert(m_hashAlgorithm != null); return m_hashAlgorithm.HashFinal(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.//
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DiagnosticsConfigurationHandler.cs
- EmptyEnumerator.cs
- DataGridViewRowCancelEventArgs.cs
- RegexFCD.cs
- LocatorPartList.cs
- SqlAggregateChecker.cs
- CssStyleCollection.cs
- ToolBarPanel.cs
- UIElementPropertyUndoUnit.cs
- InitializerFacet.cs
- AsymmetricSignatureDeformatter.cs
- PieceDirectory.cs
- DoubleUtil.cs
- ControlPaint.cs
- Selector.cs
- NavigationProperty.cs
- DispatcherTimer.cs
- HwndTarget.cs
- RoutedPropertyChangedEventArgs.cs
- DataBindingHandlerAttribute.cs
- XPathSingletonIterator.cs
- DataGridViewToolTip.cs
- TraceHwndHost.cs
- PanelStyle.cs
- FilterException.cs
- Sequence.cs
- CustomErrorCollection.cs
- ArithmeticException.cs
- RefreshPropertiesAttribute.cs
- DependencyObject.cs
- Variable.cs
- DbDataReader.cs
- IArgumentProvider.cs
- SoapEnvelopeProcessingElement.cs
- WebControl.cs
- EntitySqlQueryState.cs
- _DigestClient.cs
- DSACryptoServiceProvider.cs
- CultureSpecificStringDictionary.cs
- IsolatedStorageFile.cs
- WebScriptMetadataFormatter.cs
- MeasurementDCInfo.cs
- WizardStepBase.cs
- PageThemeCodeDomTreeGenerator.cs
- ActivityExecutorDelegateInfo.cs
- DataObjectAttribute.cs
- Listbox.cs
- objectquery_tresulttype.cs
- ScalarType.cs
- EncoderBestFitFallback.cs
- ThreadPoolTaskScheduler.cs
- DataRelationPropertyDescriptor.cs
- DelimitedListTraceListener.cs
- DayRenderEvent.cs
- itemelement.cs
- RadioButtonList.cs
- ComplexLine.cs
- Component.cs
- CatalogZoneBase.cs
- CacheOutputQuery.cs
- CompilerParameters.cs
- WindowsFormsHostPropertyMap.cs
- OdbcHandle.cs
- CodeIdentifiers.cs
- CodeDomSerializationProvider.cs
- ImageButton.cs
- BuildManagerHost.cs
- QueryTask.cs
- RegexFCD.cs
- ValidationEventArgs.cs
- StaticDataManager.cs
- IntSecurity.cs
- DataServiceClientException.cs
- MembershipValidatePasswordEventArgs.cs
- CookielessHelper.cs
- HtmlUtf8RawTextWriter.cs
- RichTextBoxConstants.cs
- WindowShowOrOpenTracker.cs
- DataBindingList.cs
- SafeSystemMetrics.cs
- OdbcReferenceCollection.cs
- Token.cs
- DtcInterfaces.cs
- DataRecordInternal.cs
- DesignerMetadata.cs
- EarlyBoundInfo.cs
- StorageAssociationTypeMapping.cs
- MemberHolder.cs
- CleanUpVirtualizedItemEventArgs.cs
- XmlSignatureManifest.cs
- x509store.cs
- InfoCardBaseException.cs
- ScalarOps.cs
- ModelUtilities.cs
- LineBreak.cs
- StringFormat.cs
- DropDownList.cs
- ListViewTableCell.cs
- ActivityBuilder.cs
- LeaseManager.cs