Code:
/ FX-1434 / FX-1434 / 1.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
- OleDbConnection.cs
- GeometryValueSerializer.cs
- SafeFileMappingHandle.cs
- TcpClientSocketManager.cs
- InvalidDocumentContentsException.cs
- ShimAsPublicXamlType.cs
- DataMemberFieldConverter.cs
- ErrorHandlingReceiver.cs
- FontFamily.cs
- DrawingContextDrawingContextWalker.cs
- DelegatingTypeDescriptionProvider.cs
- XsltFunctions.cs
- LogPolicy.cs
- GeneralTransform3DCollection.cs
- XhtmlBasicListAdapter.cs
- DocComment.cs
- WindowsRegion.cs
- CollectionContainer.cs
- EmbeddedObject.cs
- InheritedPropertyChangedEventArgs.cs
- ParameterElement.cs
- OdbcStatementHandle.cs
- mactripleDES.cs
- ProxyBuilder.cs
- RtfToken.cs
- ExternalCalls.cs
- SqlNotificationEventArgs.cs
- GeneratedView.cs
- StoryFragments.cs
- GroupBoxAutomationPeer.cs
- FrugalMap.cs
- SelectionEditingBehavior.cs
- DefinitionBase.cs
- mediaeventshelper.cs
- CallbackBehaviorAttribute.cs
- ObjectHelper.cs
- SmtpSection.cs
- XmlC14NWriter.cs
- MetadataProperty.cs
- FastEncoder.cs
- MenuItemBinding.cs
- WebPartDeleteVerb.cs
- ETagAttribute.cs
- RoleManagerEventArgs.cs
- Query.cs
- ToolStripLocationCancelEventArgs.cs
- AnnotationResource.cs
- CommonRemoteMemoryBlock.cs
- OdbcDataAdapter.cs
- StateMachineWorkflow.cs
- xmlfixedPageInfo.cs
- ProxyElement.cs
- CustomErrorsSection.cs
- ItemContainerGenerator.cs
- TextServicesLoader.cs
- JsonDataContract.cs
- OleServicesContext.cs
- XpsFilter.cs
- TreeSet.cs
- UxThemeWrapper.cs
- DataControlFieldHeaderCell.cs
- loginstatus.cs
- EDesignUtil.cs
- IDictionary.cs
- XmlSchemaInfo.cs
- sqlmetadatafactory.cs
- XmlStringTable.cs
- SelectionItemProviderWrapper.cs
- ThousandthOfEmRealPoints.cs
- HostedImpersonationContext.cs
- TemplateBindingExtension.cs
- DesignerToolboxInfo.cs
- ListViewDeletedEventArgs.cs
- DesignerLoader.cs
- HandlerMappingMemo.cs
- xmlfixedPageInfo.cs
- DrawTreeNodeEventArgs.cs
- SerializableAttribute.cs
- FieldDescriptor.cs
- PolicyException.cs
- HttpRuntime.cs
- ClientProxyGenerator.cs
- DrawingAttributesDefaultValueFactory.cs
- FileUtil.cs
- DataGridViewRowPostPaintEventArgs.cs
- ProcessMessagesAsyncResult.cs
- Automation.cs
- SafeBitVector32.cs
- StringFunctions.cs
- AsyncResult.cs
- CodeComment.cs
- FrameworkReadOnlyPropertyMetadata.cs
- StatusBar.cs
- WebRequestModuleElement.cs
- ScriptResourceInfo.cs
- TextSelectionProcessor.cs
- SymbolType.cs
- Symbol.cs
- _HeaderInfo.cs
- FixedTextBuilder.cs