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
- SchemaInfo.cs
- _SingleItemRequestCache.cs
- PeerSecurityHelpers.cs
- SpecularMaterial.cs
- Currency.cs
- Freezable.cs
- XmlnsCompatibleWithAttribute.cs
- EditorZone.cs
- FeatureSupport.cs
- RequestCachingSection.cs
- ListView.cs
- AutoScrollExpandMessageFilter.cs
- ContextDataSourceView.cs
- BlockCollection.cs
- DriveInfo.cs
- SimpleLine.cs
- StringBuilder.cs
- XmlParser.cs
- SourceFileBuildProvider.cs
- SendMailErrorEventArgs.cs
- WSTrustDec2005.cs
- FontFamily.cs
- ConfigurationElementProperty.cs
- ProcessProtocolHandler.cs
- RangeValuePatternIdentifiers.cs
- InternalsVisibleToAttribute.cs
- FilteredSchemaElementLookUpTable.cs
- SecurityRuntime.cs
- TraceSection.cs
- ToolStripCodeDomSerializer.cs
- DataGridViewEditingControlShowingEventArgs.cs
- ToolBarDesigner.cs
- AmbientProperties.cs
- PerformanceCounterLib.cs
- BitmapEffectInputConnector.cs
- WebPartTransformer.cs
- EdmTypeAttribute.cs
- XhtmlStyleClass.cs
- AutoGeneratedFieldProperties.cs
- XmlAttributeCache.cs
- DataSourceConverter.cs
- AttachedPropertyMethodSelector.cs
- ListViewDesigner.cs
- GAC.cs
- ProtocolProfile.cs
- SourceSwitch.cs
- Util.cs
- DispatcherFrame.cs
- FrameworkRichTextComposition.cs
- RegexNode.cs
- FileDialogCustomPlace.cs
- Grant.cs
- PublishLicense.cs
- ResourceReferenceExpression.cs
- OutKeywords.cs
- SizeChangedInfo.cs
- Base64Decoder.cs
- ExpressionBindingCollection.cs
- DataGridViewCellConverter.cs
- ColumnTypeConverter.cs
- ArraySubsetEnumerator.cs
- RunWorkerCompletedEventArgs.cs
- BindUriHelper.cs
- TransactionState.cs
- HandlerFactoryWrapper.cs
- ConnectionStringSettingsCollection.cs
- MailDefinition.cs
- ResolveInfo.cs
- ResourceDisplayNameAttribute.cs
- RegistryKey.cs
- ComboBoxAutomationPeer.cs
- DbConnectionHelper.cs
- ExtendedPropertyCollection.cs
- SafeUserTokenHandle.cs
- RootBrowserWindowProxy.cs
- PolicyException.cs
- SystemWebSectionGroup.cs
- File.cs
- SchemaImporterExtensionsSection.cs
- XmlMembersMapping.cs
- ConfigurationErrorsException.cs
- SetterBaseCollection.cs
- RecognizedAudio.cs
- PrincipalPermissionMode.cs
- PageAsyncTask.cs
- DbConnectionHelper.cs
- Substitution.cs
- ExpressionVisitor.cs
- CellLabel.cs
- Interop.cs
- DropSource.cs
- XmlUnspecifiedAttribute.cs
- TextEditorLists.cs
- CodeAssignStatement.cs
- MediaContextNotificationWindow.cs
- ValidatingPropertiesEventArgs.cs
- MarginCollapsingState.cs
- DiscoveryDocument.cs
- Int16Storage.cs
- PeerApplication.cs