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
- ProcessModelSection.cs
- Pkcs9Attribute.cs
- LogicalCallContext.cs
- XmlEncoding.cs
- BCryptNative.cs
- ServiceAppDomainAssociationProvider.cs
- XmlQueryType.cs
- Unit.cs
- FixedSOMLineRanges.cs
- Visitors.cs
- ScriptingSectionGroup.cs
- CodeParameterDeclarationExpressionCollection.cs
- ConnectionManagementSection.cs
- HtmlInputText.cs
- DeviceContexts.cs
- UnmanagedBitmapWrapper.cs
- ConfigurationValidatorBase.cs
- TextTreeObjectNode.cs
- DataServiceConfiguration.cs
- HostingEnvironmentSection.cs
- ArgumentException.cs
- RoleService.cs
- AsyncWaitHandle.cs
- TableCell.cs
- SafeFileMapViewHandle.cs
- MemberCollection.cs
- HtmlTextArea.cs
- DataSourceControlBuilder.cs
- Variant.cs
- NativeMethods.cs
- EpmCustomContentWriterNodeData.cs
- BitmapEffectGeneralTransform.cs
- PlaceHolder.cs
- ClientRolePrincipal.cs
- WebBrowserHelper.cs
- StringWriter.cs
- DateTimeAutomationPeer.cs
- WebResourceAttribute.cs
- DataPointer.cs
- NamespaceTable.cs
- SvcMapFileSerializer.cs
- WriteStateInfoBase.cs
- X509UI.cs
- SkipStoryboardToFill.cs
- AutoResetEvent.cs
- XsdSchemaFileEditor.cs
- TextChangedEventArgs.cs
- DesignerResources.cs
- SubstitutionList.cs
- LZCodec.cs
- COAUTHINFO.cs
- EntityDataSourceUtil.cs
- RenderCapability.cs
- ProviderCollection.cs
- CancellationTokenSource.cs
- RequestFactory.cs
- TrustVersion.cs
- DebuggerService.cs
- UniqueIdentifierService.cs
- BaseParser.cs
- UserControlBuildProvider.cs
- VisualStyleInformation.cs
- UiaCoreTypesApi.cs
- ListViewDeletedEventArgs.cs
- RadioButton.cs
- SelectionUIHandler.cs
- OperatingSystem.cs
- CodeTypeParameter.cs
- TransactionFlowProperty.cs
- DesignOnlyAttribute.cs
- GroupQuery.cs
- SmiRequestExecutor.cs
- AppDomain.cs
- GlyphsSerializer.cs
- COM2PropertyDescriptor.cs
- Block.cs
- ListViewTableRow.cs
- BackgroundFormatInfo.cs
- ToolStripLocationCancelEventArgs.cs
- HtmlInputCheckBox.cs
- AdapterDictionary.cs
- LinqTreeNodeEvaluator.cs
- RoutedEventValueSerializer.cs
- ObservableDictionary.cs
- Solver.cs
- FlowDecisionDesigner.xaml.cs
- ServerValidateEventArgs.cs
- XmlWhitespace.cs
- DotExpr.cs
- COM2Enum.cs
- FormsAuthenticationModule.cs
- DataBindingHandlerAttribute.cs
- NotificationContext.cs
- BuildProviderUtils.cs
- RightsManagementEncryptionTransform.cs
- DetailsViewUpdateEventArgs.cs
- newinstructionaction.cs
- GradientBrush.cs
- ControlType.cs
- EdmType.cs