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
- ProgressBarAutomationPeer.cs
- DesignerSerializationOptionsAttribute.cs
- SqlUserDefinedAggregateAttribute.cs
- FlowDocumentPageViewerAutomationPeer.cs
- ScrollContentPresenter.cs
- PostBackTrigger.cs
- LogFlushAsyncResult.cs
- Page.cs
- SqlCachedBuffer.cs
- CroppedBitmap.cs
- SoapDocumentServiceAttribute.cs
- SectionVisual.cs
- BamlRecordWriter.cs
- BaseValidator.cs
- Knowncolors.cs
- MarginsConverter.cs
- XslVisitor.cs
- BaseTemplateParser.cs
- PageTheme.cs
- ListSourceHelper.cs
- TypeSystem.cs
- XmlParserContext.cs
- ProviderException.cs
- UrlPath.cs
- FixedSOMContainer.cs
- ThemeDictionaryExtension.cs
- ParseNumbers.cs
- XmlSchemaInclude.cs
- XmlNavigatorFilter.cs
- XmlComplianceUtil.cs
- FieldDescriptor.cs
- CodeCatchClauseCollection.cs
- CqlErrorHelper.cs
- TypeSchema.cs
- loginstatus.cs
- IdentityReference.cs
- SequenceDesignerAccessibleObject.cs
- HashUtility.cs
- PnrpPermission.cs
- CallbackValidatorAttribute.cs
- NativeMethods.cs
- SqlTransaction.cs
- DataPager.cs
- FixedSOMPageConstructor.cs
- ColorBlend.cs
- Transform3D.cs
- Grant.cs
- SynchronizedPool.cs
- TableColumnCollection.cs
- WebPartZoneCollection.cs
- UpdatePanelControlTrigger.cs
- SecurityContext.cs
- XmlElementAttribute.cs
- IsolatedStorageFileStream.cs
- ConfigurationLocationCollection.cs
- ControlBindingsConverter.cs
- OperatingSystem.cs
- MemoryMappedView.cs
- LoginName.cs
- StateManagedCollection.cs
- WindowsListViewItemCheckBox.cs
- StrongNameIdentityPermission.cs
- AccessedThroughPropertyAttribute.cs
- DoubleKeyFrameCollection.cs
- FacetEnabledSchemaElement.cs
- SetState.cs
- RegexWriter.cs
- DataSourceComponent.cs
- DesignerLoader.cs
- MemberNameValidator.cs
- DocumentPaginator.cs
- NameTable.cs
- EpmHelper.cs
- ReflectTypeDescriptionProvider.cs
- ScalarType.cs
- BamlLocalizationDictionary.cs
- ValidationPropertyAttribute.cs
- DayRenderEvent.cs
- ChannelSinkStacks.cs
- ToolStripDropDownItem.cs
- Exceptions.cs
- TextRangeProviderWrapper.cs
- SurrogateSelector.cs
- ConfigErrorGlyph.cs
- DateTimeConverter2.cs
- PropagationProtocolsTracing.cs
- Set.cs
- XmlCharacterData.cs
- DbProviderFactoriesConfigurationHandler.cs
- SHA384CryptoServiceProvider.cs
- PageContentCollection.cs
- DataGridViewRowPrePaintEventArgs.cs
- ServiceModelActivationSectionGroup.cs
- UidManager.cs
- BamlRecords.cs
- MemberPath.cs
- SqlClientMetaDataCollectionNames.cs
- ProbeMatchesMessage11.cs
- ConnectionPoolManager.cs
- Renderer.cs