Code:
/ DotNET / DotNET / 8.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
- Italic.cs
- SqlWorkflowInstanceStore.cs
- RIPEMD160.cs
- DataContractSerializer.cs
- JournalEntry.cs
- EditorZone.cs
- InputScope.cs
- followingsibling.cs
- EventData.cs
- ImportCatalogPart.cs
- DataStreams.cs
- DataListItem.cs
- SelectionChangedEventArgs.cs
- DesigntimeLicenseContext.cs
- Converter.cs
- CodeLabeledStatement.cs
- ByeOperationCD1AsyncResult.cs
- RepeatButton.cs
- DotAtomReader.cs
- ExpressionNormalizer.cs
- Trace.cs
- Classification.cs
- SimpleMailWebEventProvider.cs
- PageWrapper.cs
- SchemaNamespaceManager.cs
- ByteStorage.cs
- ButtonBaseAutomationPeer.cs
- DataTableExtensions.cs
- ExeContext.cs
- SafeNativeMemoryHandle.cs
- RtfControlWordInfo.cs
- XmlFormatReaderGenerator.cs
- PlanCompiler.cs
- SqlDataReader.cs
- GifBitmapEncoder.cs
- SecureStringHasher.cs
- FragmentQueryKB.cs
- MimeParameter.cs
- BlurBitmapEffect.cs
- StickyNoteHelper.cs
- BitmapDownload.cs
- TargetParameterCountException.cs
- DataGridRowDetailsEventArgs.cs
- DataGridViewRowEventArgs.cs
- SmiGettersStream.cs
- RemotingAttributes.cs
- ReadOnlyAttribute.cs
- InputMethodStateChangeEventArgs.cs
- SqlCachedBuffer.cs
- DeviceContexts.cs
- TrustManagerPromptUI.cs
- ServerIdentity.cs
- TextAction.cs
- PropertyGridCommands.cs
- DbDataRecord.cs
- WebPartManager.cs
- DataGridColumn.cs
- Executor.cs
- XmlSchemaAttributeGroup.cs
- InstanceOwner.cs
- EntityDataReader.cs
- ToolboxBitmapAttribute.cs
- MethodImplAttribute.cs
- QuadraticBezierSegment.cs
- _UncName.cs
- BoundsDrawingContextWalker.cs
- HttpProfileBase.cs
- PolyBezierSegment.cs
- DataGridViewImageColumn.cs
- FontDriver.cs
- XmlAtomicValue.cs
- ObjectStateManager.cs
- RepeaterItemCollection.cs
- coordinator.cs
- ProcessModelInfo.cs
- MessageQueueKey.cs
- TypeConverterValueSerializer.cs
- nulltextnavigator.cs
- CalendarSelectionChangedEventArgs.cs
- DictionaryTraceRecord.cs
- FieldAccessException.cs
- TableCell.cs
- ReferencedType.cs
- InternalControlCollection.cs
- XPathNodeInfoAtom.cs
- XmlSchemaDocumentation.cs
- SqlDataSourceSelectingEventArgs.cs
- SqlDataSourceSelectingEventArgs.cs
- AppDomainAttributes.cs
- relpropertyhelper.cs
- ProviderCollection.cs
- MetadataExporter.cs
- BamlReader.cs
- infer.cs
- XmlText.cs
- Constants.cs
- DesignBindingValueUIHandler.cs
- OracleLob.cs
- WebPartExportVerb.cs
- WindowsGraphicsCacheManager.cs