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
- SmtpLoginAuthenticationModule.cs
- XmlBoundElement.cs
- FilterRepeater.cs
- HyperLinkColumn.cs
- OrCondition.cs
- QuotedPairReader.cs
- ConnectionInterfaceCollection.cs
- TextSelection.cs
- EnlistmentState.cs
- ProcessThreadCollection.cs
- GridErrorDlg.cs
- Stroke.cs
- EnumDataContract.cs
- OdbcException.cs
- SqlNodeTypeOperators.cs
- XmlQueryTypeFactory.cs
- RequestTimeoutManager.cs
- SiteMapHierarchicalDataSourceView.cs
- PointHitTestParameters.cs
- TriggerAction.cs
- EqualityComparer.cs
- FileUtil.cs
- ToolStripSystemRenderer.cs
- X509Utils.cs
- TextTreeTextNode.cs
- SystemWebSectionGroup.cs
- EventWaitHandleSecurity.cs
- ArrangedElementCollection.cs
- DataGridTablesFactory.cs
- ExtenderProvidedPropertyAttribute.cs
- AppSettingsReader.cs
- UnitySerializationHolder.cs
- DesignerLoader.cs
- ReplyChannelAcceptor.cs
- CachedBitmap.cs
- StorageEndPropertyMapping.cs
- UserPreferenceChangingEventArgs.cs
- RemotingServices.cs
- SchemaImporter.cs
- SafeHandle.cs
- XmlSchemaType.cs
- Label.cs
- SoapAttributes.cs
- HtmlSelect.cs
- SystemIcons.cs
- UnsafeNetInfoNativeMethods.cs
- SiteMapPath.cs
- DictionaryBase.cs
- TextTreeExtractElementUndoUnit.cs
- SimplePropertyEntry.cs
- IisTraceWebEventProvider.cs
- AddInServer.cs
- SQLInt64.cs
- OLEDB_Enum.cs
- OdbcConnectionString.cs
- Cursors.cs
- DispatcherSynchronizationContext.cs
- CombinedGeometry.cs
- UnitySerializationHolder.cs
- WeakRefEnumerator.cs
- ThousandthOfEmRealPoints.cs
- HighContrastHelper.cs
- TripleDES.cs
- FontStyle.cs
- DrawingAttributeSerializer.cs
- WebPartAddingEventArgs.cs
- PropertyExpression.cs
- DetailsViewPagerRow.cs
- Rect3D.cs
- SweepDirectionValidation.cs
- SignedXml.cs
- GlyphsSerializer.cs
- InterleavedZipPartStream.cs
- ColumnBinding.cs
- InheritanceContextChangedEventManager.cs
- CreateDataSourceDialog.cs
- SerialPort.cs
- TiffBitmapDecoder.cs
- VariantWrapper.cs
- SortedSet.cs
- ControlBuilderAttribute.cs
- HtmlInputRadioButton.cs
- Transform3DGroup.cs
- PropertyDescriptorComparer.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ConnectionStringsSection.cs
- OdbcError.cs
- TextDecorationCollection.cs
- XXXInfos.cs
- StateMachineDesignerPaint.cs
- precedingsibling.cs
- MailHeaderInfo.cs
- SessionParameter.cs
- ObjectDataSourceDisposingEventArgs.cs
- MachineKeyConverter.cs
- ValueConversionAttribute.cs
- ObjectQueryState.cs
- TreeWalker.cs
- DropDownButton.cs
- CodeTypeOfExpression.cs