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
- ISFTagAndGuidCache.cs
- SimpleLine.cs
- StorageEntitySetMapping.cs
- SamlEvidence.cs
- Point3DCollectionConverter.cs
- NodeLabelEditEvent.cs
- BuildProvider.cs
- PerfCounterSection.cs
- SystemSounds.cs
- InvalidAsynchronousStateException.cs
- ButtonColumn.cs
- ConsumerConnectionPoint.cs
- WebConvert.cs
- HMACSHA512.cs
- Script.cs
- RegexCharClass.cs
- FontStretch.cs
- CursorConverter.cs
- ObjectDataSourceDisposingEventArgs.cs
- path.cs
- SequentialActivityDesigner.cs
- PatternMatcher.cs
- NavigationPropertySingletonExpression.cs
- Double.cs
- SchemaCollectionCompiler.cs
- TagMapInfo.cs
- TextEditorTyping.cs
- TabPanel.cs
- ToolStripArrowRenderEventArgs.cs
- ConsoleKeyInfo.cs
- behaviorssection.cs
- WriteFileContext.cs
- IndexedString.cs
- ImmComposition.cs
- XmlSchemaType.cs
- Win32KeyboardDevice.cs
- Resources.Designer.cs
- HttpTransportElement.cs
- StylusLogic.cs
- AstTree.cs
- PathParser.cs
- DropTarget.cs
- ElementUtil.cs
- XPathSelectionIterator.cs
- VisualStyleTypesAndProperties.cs
- Decorator.cs
- FixedFlowMap.cs
- ActivityExecutorOperation.cs
- DetailsViewRowCollection.cs
- NameScopePropertyAttribute.cs
- UserControl.cs
- SimpleParser.cs
- CompositeActivityValidator.cs
- InertiaExpansionBehavior.cs
- FunctionMappingTranslator.cs
- TimeManager.cs
- ScriptReferenceEventArgs.cs
- MaterialCollection.cs
- PageParserFilter.cs
- AutomationPatternInfo.cs
- CompModSwitches.cs
- BridgeDataRecord.cs
- ScriptRegistrationManager.cs
- JpegBitmapDecoder.cs
- Activator.cs
- SerializationHelper.cs
- Matrix3D.cs
- AnonymousIdentificationSection.cs
- CfgParser.cs
- WebBrowserContainer.cs
- TagPrefixAttribute.cs
- RequestContext.cs
- DataGridViewCellValidatingEventArgs.cs
- WmfPlaceableFileHeader.cs
- StringDictionary.cs
- ListSourceHelper.cs
- ZipIOExtraFieldPaddingElement.cs
- ObjectListDesigner.cs
- DrawingServices.cs
- CustomAttributeBuilder.cs
- EntityDesignPluralizationHandler.cs
- BrowserDefinition.cs
- KnownTypesProvider.cs
- Scene3D.cs
- DesignTimeParseData.cs
- Knowncolors.cs
- FreezableCollection.cs
- LocalizationParserHooks.cs
- ResourceExpressionBuilder.cs
- RecognizedAudio.cs
- SqlDataSourceConnectionPanel.cs
- UIPermission.cs
- UserPreferenceChangingEventArgs.cs
- CompoundFileStreamReference.cs
- ConfigurationValues.cs
- GenericTypeParameterBuilder.cs
- InplaceBitmapMetadataWriter.cs
- SmtpNetworkElement.cs
- KnownColorTable.cs
- ProfileBuildProvider.cs