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
- ResourcesBuildProvider.cs
- ToolStripItemEventArgs.cs
- ObjectPropertyMapping.cs
- DataGridViewCellLinkedList.cs
- PageSetupDialog.cs
- SetIndexBinder.cs
- XmlHierarchicalDataSourceView.cs
- CacheMemory.cs
- returneventsaver.cs
- FontSourceCollection.cs
- SchemaEntity.cs
- PolyQuadraticBezierSegment.cs
- GlobalEventManager.cs
- StaticDataManager.cs
- ClientProxyGenerator.cs
- ProcessHostFactoryHelper.cs
- _KerberosClient.cs
- GenericTextProperties.cs
- SetIndexBinder.cs
- SortDescriptionCollection.cs
- _LocalDataStore.cs
- CheckoutException.cs
- XmlQueryStaticData.cs
- DbConnectionFactory.cs
- AmbientLight.cs
- DataGridViewCellPaintingEventArgs.cs
- NegotiateStream.cs
- OdbcError.cs
- SemaphoreSlim.cs
- HtmlWindow.cs
- CommonDialog.cs
- MessageAction.cs
- WorkflowMarkupSerializationManager.cs
- TemplateBaseAction.cs
- InheritanceContextChangedEventManager.cs
- DelayLoadType.cs
- RotateTransform3D.cs
- FilterQueryOptionExpression.cs
- LocatorBase.cs
- HTTPAPI_VERSION.cs
- EraserBehavior.cs
- UInt64Converter.cs
- DelegatingHeader.cs
- SoapCommonClasses.cs
- WindowsListViewItemCheckBox.cs
- ZipIORawDataFileBlock.cs
- ProfessionalColors.cs
- OdbcDataAdapter.cs
- BlobPersonalizationState.cs
- XmlSortKey.cs
- safex509handles.cs
- HtmlTableRowCollection.cs
- XmlAttributeAttribute.cs
- TitleStyle.cs
- SpellerHighlightLayer.cs
- StateManagedCollection.cs
- ColorConverter.cs
- XPathNodeIterator.cs
- ParameterModifier.cs
- QueryStringParameter.cs
- UriParserTemplates.cs
- ButtonChrome.cs
- StackSpiller.cs
- ObjectViewQueryResultData.cs
- ButtonChrome.cs
- _AuthenticationState.cs
- HandlerBase.cs
- FaultCallbackWrapper.cs
- _TransmitFileOverlappedAsyncResult.cs
- TableCell.cs
- GridViewSelectEventArgs.cs
- ReadOnlyCollectionBuilder.cs
- GridLength.cs
- CommandLineParser.cs
- SchemaObjectWriter.cs
- HtmlContainerControl.cs
- FixedSOMPageElement.cs
- DefaultProxySection.cs
- PropagatorResult.cs
- FrameworkElement.cs
- RightsManagementProvider.cs
- CalendarBlackoutDatesCollection.cs
- SiteIdentityPermission.cs
- CngKeyCreationParameters.cs
- TrustManagerMoreInformation.cs
- ScriptManagerProxy.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- ReferenceConverter.cs
- NumericUpDownAccelerationCollection.cs
- MustUnderstandSoapException.cs
- ConfigurationManagerHelperFactory.cs
- HostingEnvironmentWrapper.cs
- Repeater.cs
- RemotingConfigParser.cs
- ProgressBarAutomationPeer.cs
- PropertyPath.cs
- MenuItemStyleCollection.cs
- PeerObject.cs
- CmsInterop.cs
- BindingContext.cs