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
- InProcStateClientManager.cs
- ExtractedStateEntry.cs
- CodeMethodReturnStatement.cs
- TypeHelpers.cs
- RoutedUICommand.cs
- CorrelationInitializer.cs
- ListCommandEventArgs.cs
- Mutex.cs
- CodeNamespace.cs
- TypeDependencyAttribute.cs
- BitmapEffectGroup.cs
- BufferedGraphicsContext.cs
- ObjectQuery.cs
- HtmlTextArea.cs
- PipelineDeploymentState.cs
- XmlLinkedNode.cs
- COM2FontConverter.cs
- SequenceDesigner.cs
- PhonemeConverter.cs
- FaultException.cs
- Timer.cs
- FragmentQueryKB.cs
- ObjectDataSourceSelectingEventArgs.cs
- TextTreeTextNode.cs
- LicenseException.cs
- MemberPathMap.cs
- DataControlButton.cs
- HelloMessageCD1.cs
- followingquery.cs
- XmlSchemaExporter.cs
- XmlSchemaComplexType.cs
- Set.cs
- TrustSection.cs
- ISFTagAndGuidCache.cs
- EmptyStringExpandableObjectConverter.cs
- ConfigurationStrings.cs
- RegisteredHiddenField.cs
- HelpEvent.cs
- DataSourceXmlSerializationAttribute.cs
- LoginUtil.cs
- BooleanProjectedSlot.cs
- SecurityCriticalDataForSet.cs
- HttpContext.cs
- StorageSetMapping.cs
- MgmtConfigurationRecord.cs
- HttpRequestCacheValidator.cs
- ValidatorCompatibilityHelper.cs
- EnumConverter.cs
- BinaryQueryOperator.cs
- ProcessThread.cs
- UInt64Storage.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- DrawingState.cs
- GeneralTransform3DTo2D.cs
- TextSimpleMarkerProperties.cs
- WindowsAuthenticationModule.cs
- FileDialog.cs
- CodeThrowExceptionStatement.cs
- XmlSchemaAttributeGroup.cs
- ServiceMetadataBehavior.cs
- TextServicesHost.cs
- DATA_BLOB.cs
- TrackingStringDictionary.cs
- Assert.cs
- PrinterUnitConvert.cs
- SafePEFileHandle.cs
- AssemblyNameProxy.cs
- TransformPatternIdentifiers.cs
- SynchronizedPool.cs
- WinEventQueueItem.cs
- SocketAddress.cs
- WizardStepBase.cs
- AssociatedControlConverter.cs
- Sentence.cs
- WebPartConnectionsCancelEventArgs.cs
- SiteMapNode.cs
- BaseAddressElement.cs
- IsolationInterop.cs
- DiscoveryReferences.cs
- WebException.cs
- ObjectSpanRewriter.cs
- sqlcontext.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- InvokeHandlers.cs
- WithStatement.cs
- XMLUtil.cs
- WebBrowserNavigatedEventHandler.cs
- FormsAuthenticationModule.cs
- RuleSettingsCollection.cs
- UseManagedPresentationElement.cs
- Image.cs
- DescendantBaseQuery.cs
- SiblingIterators.cs
- ParameterModifier.cs
- DetailsViewInsertedEventArgs.cs
- ThemeInfoAttribute.cs
- InternalMappingException.cs
- DoubleConverter.cs
- OperatorExpressions.cs
- TargetInvocationException.cs