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
- MouseDevice.cs
- UnsafeNativeMethods.cs
- InvokerUtil.cs
- StreamSecurityUpgradeInitiatorAsyncResult.cs
- ping.cs
- ReaderWriterLockSlim.cs
- AccessText.cs
- FunctionParameter.cs
- MarshalDirectiveException.cs
- ListView.cs
- ViewCellSlot.cs
- ExpandSegment.cs
- DateTimeEditor.cs
- JsonEnumDataContract.cs
- NegatedConstant.cs
- TypeHelpers.cs
- UserMapPath.cs
- EdmToObjectNamespaceMap.cs
- ObjectConverter.cs
- ScrollChangedEventArgs.cs
- XPathDocumentNavigator.cs
- ASCIIEncoding.cs
- TextParagraphProperties.cs
- DatatypeImplementation.cs
- SimpleNameService.cs
- PowerModeChangedEventArgs.cs
- SecurityIdentifierElementCollection.cs
- WindowsListViewGroupHelper.cs
- BitmapCodecInfoInternal.cs
- SchemaSetCompiler.cs
- Funcletizer.cs
- CodeStatementCollection.cs
- newinstructionaction.cs
- _DomainName.cs
- Collection.cs
- MessagePropertyDescriptionCollection.cs
- XmlSecureResolver.cs
- GridItemProviderWrapper.cs
- FunctionUpdateCommand.cs
- ParserOptions.cs
- Label.cs
- GeneralTransform.cs
- XsdCachingReader.cs
- DataRow.cs
- ActivityCodeDomReferenceService.cs
- COM2IProvidePropertyBuilderHandler.cs
- WS2007HttpBinding.cs
- ScopeCompiler.cs
- WebPartDisplayMode.cs
- SettingsAttributeDictionary.cs
- Label.cs
- SqlBulkCopyColumnMapping.cs
- LexicalChunk.cs
- SR.cs
- FreeIndexList.cs
- OrderingExpression.cs
- JavaScriptSerializer.cs
- RemoteHelper.cs
- TrackingExtract.cs
- RenderDataDrawingContext.cs
- Component.cs
- MSAAWinEventWrap.cs
- TableLayoutStyle.cs
- AudioFormatConverter.cs
- GrammarBuilder.cs
- SafeFileMappingHandle.cs
- GridView.cs
- TraceHandlerErrorFormatter.cs
- Win32KeyboardDevice.cs
- AttributeCollection.cs
- PenContext.cs
- ReachNamespaceInfo.cs
- FlowDocumentScrollViewer.cs
- Brush.cs
- MLangCodePageEncoding.cs
- EntityContainer.cs
- Compilation.cs
- ColorContextHelper.cs
- ReturnEventArgs.cs
- MULTI_QI.cs
- FloaterParaClient.cs
- ResXFileRef.cs
- AnonymousIdentificationSection.cs
- DataGridColumnReorderingEventArgs.cs
- AuthorizationSection.cs
- TimeZoneNotFoundException.cs
- Walker.cs
- invalidudtexception.cs
- XMLDiffLoader.cs
- DataBindingList.cs
- SqlVersion.cs
- PermissionSetEnumerator.cs
- DataGridColumnsPage.cs
- HttpClientCertificate.cs
- HashHelper.cs
- NumberFunctions.cs
- CodeObjectCreateExpression.cs
- GroupBox.cs
- XamlTypeMapperSchemaContext.cs
- HttpPostLocalhostServerProtocol.cs