Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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
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
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);
}
}
}
// 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
- MutexSecurity.cs
- FastPropertyAccessor.cs
- PropertyPath.cs
- ExpressionConverter.cs
- BackgroundWorker.cs
- CompilationPass2TaskInternal.cs
- TreeViewDataItemAutomationPeer.cs
- XmlAttributeCache.cs
- VariableDesigner.xaml.cs
- HtmlTernaryTree.cs
- CounterSample.cs
- WebBrowserPermission.cs
- IntSumAggregationOperator.cs
- Operators.cs
- XPathSingletonIterator.cs
- HighlightComponent.cs
- RequestCacheEntry.cs
- PlatformNotSupportedException.cs
- PinnedBufferMemoryStream.cs
- KeyInstance.cs
- CellParagraph.cs
- InstanceLockedException.cs
- XPathChildIterator.cs
- WindowsComboBox.cs
- SqlDataSource.cs
- PassportIdentity.cs
- DataGridViewButtonCell.cs
- BitmapMetadata.cs
- WindowsListViewScroll.cs
- ContentElement.cs
- CheckBoxAutomationPeer.cs
- DataFormat.cs
- RelOps.cs
- WebPartActionVerb.cs
- CodePageEncoding.cs
- EventListenerClientSide.cs
- Utils.cs
- FormViewInsertedEventArgs.cs
- ExpressionEditorAttribute.cs
- GlyphsSerializer.cs
- DataColumn.cs
- DataTransferEventArgs.cs
- ContainerFilterService.cs
- RegexMatch.cs
- HttpApplication.cs
- DropDownList.cs
- ExtensionDataReader.cs
- _ListenerAsyncResult.cs
- TypedAsyncResult.cs
- TypeViewSchema.cs
- WindowsFormsSynchronizationContext.cs
- ToolStripRenderEventArgs.cs
- FontNamesConverter.cs
- RtfToXamlReader.cs
- OdbcDataAdapter.cs
- GridItem.cs
- NamespaceMapping.cs
- TraceLevelHelper.cs
- altserialization.cs
- UTF8Encoding.cs
- XmlDataCollection.cs
- ContentType.cs
- TextServicesContext.cs
- GridViewUpdatedEventArgs.cs
- InkPresenterAutomationPeer.cs
- SpeechDetectedEventArgs.cs
- ValidatorUtils.cs
- StreamWriter.cs
- ChainOfDependencies.cs
- ProtocolViolationException.cs
- SchemaNotation.cs
- ListViewHitTestInfo.cs
- CodeMemberField.cs
- ParameterSubsegment.cs
- AutomationElement.cs
- FormViewModeEventArgs.cs
- PropertyCollection.cs
- FaultDescriptionCollection.cs
- ManagementEventArgs.cs
- TextContainerHelper.cs
- QilList.cs
- FieldNameLookup.cs
- DefaultTraceListener.cs
- SplitterCancelEvent.cs
- XmlSchemaObject.cs
- PathFigureCollection.cs
- RouteData.cs
- EdmMember.cs
- DependencyProperty.cs
- InfoCardKeyedHashAlgorithm.cs
- CompatibleComparer.cs
- AppDomainUnloadedException.cs
- SqlVersion.cs
- ActivationServices.cs
- ProfileBuildProvider.cs
- PublisherMembershipCondition.cs
- SetStoryboardSpeedRatio.cs
- InputLanguageSource.cs
- DetailsViewRow.cs
- DesigntimeLicenseContext.cs