Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / clr / src / BCL / System / Security / Cryptography / SHA1CryptoServiceProvider.cs / 1 / SHA1CryptoServiceProvider.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // SHA1CryptoServiceProvider.cs // namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public sealed class SHA1CryptoServiceProvider : SHA1 { private SafeHashHandle _safeHashHandle = null; // // public constructors // public SHA1CryptoServiceProvider() { SafeHashHandle safeHashHandle = SafeHashHandle.InvalidHandle; // _CreateHash will check for failures and throw the appropriate exception Utils._CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1, ref safeHashHandle); _safeHashHandle = safeHashHandle; } protected override void Dispose(bool disposing) { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); // call the base class's 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_SHA1, 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // SHA1CryptoServiceProvider.cs // namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public sealed class SHA1CryptoServiceProvider : SHA1 { private SafeHashHandle _safeHashHandle = null; // // public constructors // public SHA1CryptoServiceProvider() { SafeHashHandle safeHashHandle = SafeHashHandle.InvalidHandle; // _CreateHash will check for failures and throw the appropriate exception Utils._CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1, ref safeHashHandle); _safeHashHandle = safeHashHandle; } protected override void Dispose(bool disposing) { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); // call the base class's 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_SHA1, 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BuildProviderAppliesToAttribute.cs
- SafeProcessHandle.cs
- XmlQueryRuntime.cs
- HtmlControl.cs
- RequestResponse.cs
- ViewStateException.cs
- GeometryGroup.cs
- BinaryUtilClasses.cs
- TransformDescriptor.cs
- GcHandle.cs
- CodeBlockBuilder.cs
- Point3DAnimation.cs
- DataKey.cs
- ConfigXmlAttribute.cs
- EntityDataSourceWizardForm.cs
- DocumentViewerBase.cs
- CorrelationManager.cs
- DispatcherOperation.cs
- InputScopeNameConverter.cs
- User.cs
- Converter.cs
- InvokePatternIdentifiers.cs
- ToolBarPanel.cs
- DebugTracing.cs
- TableCell.cs
- MemberCollection.cs
- RetrieveVirtualItemEventArgs.cs
- DataServiceProcessingPipelineEventArgs.cs
- DataSourceView.cs
- EntitySetDataBindingList.cs
- RequiredFieldValidator.cs
- UnknownBitmapEncoder.cs
- EraserBehavior.cs
- PeerResolver.cs
- GridViewHeaderRowPresenter.cs
- CompilerScopeManager.cs
- ScriptMethodAttribute.cs
- SecurityNegotiationException.cs
- Soap12ProtocolImporter.cs
- FieldNameLookup.cs
- WebCategoryAttribute.cs
- Renderer.cs
- MarkupCompiler.cs
- CharConverter.cs
- TableColumn.cs
- InputGestureCollection.cs
- DragDrop.cs
- BinaryMethodMessage.cs
- VisualStyleInformation.cs
- KeyValueConfigurationCollection.cs
- ClientSettings.cs
- TextElementEnumerator.cs
- SqlDataSourceCache.cs
- MessagePartProtectionMode.cs
- PingOptions.cs
- TrackingWorkflowEventArgs.cs
- WindowsComboBox.cs
- Container.cs
- DragEventArgs.cs
- TextDecorationCollectionConverter.cs
- WindowsListBox.cs
- MSAANativeProvider.cs
- OleDbCommandBuilder.cs
- DataServiceRequestOfT.cs
- FileCodeGroup.cs
- DbProviderFactoriesConfigurationHandler.cs
- StrokeNodeEnumerator.cs
- Comparer.cs
- ColorAnimation.cs
- HtmlContainerControl.cs
- PhysicalFontFamily.cs
- RubberbandSelector.cs
- CorrelationService.cs
- BitmapDecoder.cs
- Transform3DGroup.cs
- ToolStripDropDownButton.cs
- ObjectManager.cs
- ProcessManager.cs
- BlurBitmapEffect.cs
- ValueQuery.cs
- StrokeDescriptor.cs
- initElementDictionary.cs
- RotateTransform3D.cs
- MeshGeometry3D.cs
- PersistenceException.cs
- LayoutTableCell.cs
- BrowserCapabilitiesFactoryBase.cs
- SqlDataSourceStatusEventArgs.cs
- PublisherIdentityPermission.cs
- QilFactory.cs
- FormatConvertedBitmap.cs
- FixedSOMPageElement.cs
- Span.cs
- FunctionImportMapping.cs
- XmlComplianceUtil.cs
- XPathDocumentBuilder.cs
- MulticastDelegate.cs
- Positioning.cs
- FileAuthorizationModule.cs
- ImageIndexEditor.cs