Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Security / Cryptography / MD5CryptoServiceProvider.cs / 1 / MD5CryptoServiceProvider.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // MD5CryptoServiceProvider.cs // namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public sealed class MD5CryptoServiceProvider : MD5 { private SafeHashHandle _safeHashHandle = null; // // public constructors // public MD5CryptoServiceProvider() { if (Utils.FipsAlgorithmPolicy == 1) throw new InvalidOperationException(Environment.GetResourceString("Cryptography_NonCompliantFIPSAlgorithm")); SafeHashHandle safeHashHandle = SafeHashHandle.InvalidHandle; // _CreateHash will check for failures and throw the appropriate exception Utils._CreateHash(Utils.StaticProvHandle, Constants.CALG_MD5, ref safeHashHandle); _safeHashHandle = safeHashHandle; } protected override void Dispose(bool disposing) { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); base.Dispose(disposing); } // // public methods // public override void Initialize() { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); SafeHashHandle safeHashHandle = SafeHashHandle.InvalidHandle; // _CreateHash will check for failures and throw the appropriate exception Utils._CreateHash(Utils.StaticProvHandle, Constants.CALG_MD5, ref safeHashHandle); _safeHashHandle = safeHashHandle; } protected override void HashCore(byte[] rgb, int ibStart, int cbSize) { Utils._HashData(_safeHashHandle, rgb, ibStart, cbSize); } protected override byte[] HashFinal() { return Utils._EndHash(_safeHashHandle); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MobileControlPersister.cs
- _IPv4Address.cs
- ElementHostPropertyMap.cs
- SamlDelegatingWriter.cs
- Overlapped.cs
- Line.cs
- Operand.cs
- ToolStripGripRenderEventArgs.cs
- WebServiceData.cs
- XsdBuilder.cs
- DynamicRendererThreadManager.cs
- ReadWriteSpinLock.cs
- AliasGenerator.cs
- ContractAdapter.cs
- RecommendedAsConfigurableAttribute.cs
- WebPartTransformerAttribute.cs
- SafeNativeMethods.cs
- Point3DAnimationBase.cs
- WorkflowControlEndpoint.cs
- Rfc2898DeriveBytes.cs
- Int32EqualityComparer.cs
- PathSegment.cs
- EmptyStringExpandableObjectConverter.cs
- TypeToken.cs
- WindowsUpDown.cs
- BinaryMethodMessage.cs
- PropertyMapper.cs
- SystemNetworkInterface.cs
- MultiAsyncResult.cs
- ThrowHelper.cs
- WizardForm.cs
- ThicknessAnimationBase.cs
- XmlSchemaComplexContentExtension.cs
- DataServiceConfiguration.cs
- URLIdentityPermission.cs
- XmlSchemaObject.cs
- ParameterToken.cs
- CodeArrayIndexerExpression.cs
- CustomAttributeFormatException.cs
- IgnorePropertiesAttribute.cs
- DocumentViewerConstants.cs
- TemplateModeChangedEventArgs.cs
- SingleConverter.cs
- panel.cs
- EntityClientCacheKey.cs
- RetrieveVirtualItemEventArgs.cs
- autovalidator.cs
- NumericUpDownAccelerationCollection.cs
- SiteMapProvider.cs
- MetadataArtifactLoaderCompositeFile.cs
- ProgressBar.cs
- SqlNamer.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- BuilderPropertyEntry.cs
- PathData.cs
- TimerElapsedEvenArgs.cs
- CodeTypeMemberCollection.cs
- XmlWhitespace.cs
- CalendarDesigner.cs
- XamlFrame.cs
- ControlValuePropertyAttribute.cs
- BasicHttpBindingCollectionElement.cs
- WrapPanel.cs
- XPathPatternBuilder.cs
- VerticalConnector.xaml.cs
- EntitySqlException.cs
- FixedSOMPageElement.cs
- ApplicationFileParser.cs
- TriggerBase.cs
- Roles.cs
- TemplateModeChangedEventArgs.cs
- _NestedMultipleAsyncResult.cs
- ResourceManagerWrapper.cs
- securitycriticaldataClass.cs
- ItemType.cs
- ResponseBodyWriter.cs
- Metadata.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- BindingCompleteEventArgs.cs
- ReachPageContentCollectionSerializer.cs
- TabControl.cs
- Stopwatch.cs
- QilReference.cs
- WebControlAdapter.cs
- WebBrowserSiteBase.cs
- WebPartVerb.cs
- CodeAttributeArgumentCollection.cs
- ValidationRule.cs
- HMACSHA384.cs
- UnsafeMethods.cs
- ThemeDirectoryCompiler.cs
- DataControlFieldCell.cs
- AssemblyBuilder.cs
- WindowsFormsHostAutomationPeer.cs
- TypeDescriptor.cs
- CanonicalFontFamilyReference.cs
- UnicastIPAddressInformationCollection.cs
- CollectionTypeElement.cs
- CookieProtection.cs
- WebPartCatalogCloseVerb.cs