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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MsmqIntegrationMessageProperty.cs
- SQLInt64.cs
- TransportSecurityProtocolFactory.cs
- WeakReferenceList.cs
- XmlDataProvider.cs
- GroupBoxAutomationPeer.cs
- TextServicesHost.cs
- Group.cs
- HttpResponseInternalWrapper.cs
- ArithmeticException.cs
- EpmTargetPathSegment.cs
- SourceFilter.cs
- ReaderContextStackData.cs
- JsonGlobals.cs
- WebBrowserNavigatingEventHandler.cs
- ObjectDataSourceDesigner.cs
- MultiTargetingUtil.cs
- XmlSerializerFactory.cs
- SqlPersonalizationProvider.cs
- ResourceKey.cs
- XmlConvert.cs
- PrintControllerWithStatusDialog.cs
- ReflectionTypeLoadException.cs
- TransactionScope.cs
- DataException.cs
- XmlnsDefinitionAttribute.cs
- SerializableAttribute.cs
- StructuralCache.cs
- SiteMapNodeItem.cs
- ScaleTransform3D.cs
- BufferAllocator.cs
- NewArrayExpression.cs
- RegexCaptureCollection.cs
- __Filters.cs
- ThaiBuddhistCalendar.cs
- DbReferenceCollection.cs
- BufferBuilder.cs
- LinkButton.cs
- _RequestCacheProtocol.cs
- BitmapDecoder.cs
- LoginStatusDesigner.cs
- InfoCardKeyedHashAlgorithm.cs
- EventLogPermissionAttribute.cs
- Paragraph.cs
- Utils.cs
- CharacterMetrics.cs
- AuthenticatingEventArgs.cs
- CompositeKey.cs
- Transform.cs
- RegexTree.cs
- SqlDataSourceFilteringEventArgs.cs
- MessageDecoder.cs
- MetadataExchangeClient.cs
- GlyphElement.cs
- StateWorkerRequest.cs
- GlyphInfoList.cs
- WsatTransactionFormatter.cs
- HitTestResult.cs
- RegexMatchCollection.cs
- NetNamedPipeSecurity.cs
- UnsafeNativeMethods.cs
- CustomErrorsSectionWrapper.cs
- PageCatalogPart.cs
- Geometry.cs
- MemberRelationshipService.cs
- ProxyOperationRuntime.cs
- HtmlTitle.cs
- ToolStripDropDownClosedEventArgs.cs
- AdornerPresentationContext.cs
- ProbeMatches11.cs
- AmbiguousMatchException.cs
- ImpersonationContext.cs
- ArgumentException.cs
- CryptoProvider.cs
- CompilerParameters.cs
- System.Data.OracleClient_BID.cs
- GenericsInstances.cs
- FieldBuilder.cs
- Propagator.cs
- Rect3DConverter.cs
- EdmComplexTypeAttribute.cs
- HTMLTextWriter.cs
- Stackframe.cs
- sitestring.cs
- xmlfixedPageInfo.cs
- TransformedBitmap.cs
- NullReferenceException.cs
- LookupNode.cs
- StatusBar.cs
- AffineTransform3D.cs
- StringReader.cs
- Graphics.cs
- XmlUtil.cs
- DecoderBestFitFallback.cs
- SelectionPattern.cs
- SortDescription.cs
- GB18030Encoding.cs
- FixedSchema.cs
- SystemInformation.cs
- SynchronizedPool.cs