Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Cryptography / SHA1CryptoServiceProvider.cs / 1305376 / 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 { [System.Security.SecurityCritical /*auto-generated*/] private SafeHashHandle _safeHashHandle = null; // // public constructors // [System.Security.SecuritySafeCritical] // auto-generated public SHA1CryptoServiceProvider() { // _CreateHash will check for failures and throw the appropriate exception _safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1); } [System.Security.SecuritySafeCritical] // overrides public transparent member protected override void Dispose(bool disposing) { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); // call the base class's Dispose base.Dispose(disposing); } // // public methods // [System.Security.SecuritySafeCritical] // auto-generated public override void Initialize() { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); // _CreateHash will check for failures and throw the appropriate exception _safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1); } [System.Security.SecuritySafeCritical] // overrides protected transparent member protected override void HashCore(byte[] rgb, int ibStart, int cbSize) { Utils.HashData(_safeHashHandle, rgb, ibStart, cbSize); } [System.Security.SecuritySafeCritical] // overrides protected transparent member 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 { [System.Security.SecurityCritical /*auto-generated*/] private SafeHashHandle _safeHashHandle = null; // // public constructors // [System.Security.SecuritySafeCritical] // auto-generated public SHA1CryptoServiceProvider() { // _CreateHash will check for failures and throw the appropriate exception _safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1); } [System.Security.SecuritySafeCritical] // overrides public transparent member protected override void Dispose(bool disposing) { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); // call the base class's Dispose base.Dispose(disposing); } // // public methods // [System.Security.SecuritySafeCritical] // auto-generated public override void Initialize() { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); // _CreateHash will check for failures and throw the appropriate exception _safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1); } [System.Security.SecuritySafeCritical] // overrides protected transparent member protected override void HashCore(byte[] rgb, int ibStart, int cbSize) { Utils.HashData(_safeHashHandle, rgb, ibStart, cbSize); } [System.Security.SecuritySafeCritical] // overrides protected transparent member 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
- ReadOnlyPropertyMetadata.cs
- ElementHostAutomationPeer.cs
- BitmapEffectInput.cs
- PersonalizationAdministration.cs
- Helper.cs
- Int32Storage.cs
- XmlAttributeAttribute.cs
- PersonalizationStateInfo.cs
- AppSettingsSection.cs
- Scalars.cs
- Screen.cs
- OleDbFactory.cs
- Control.cs
- OleDbException.cs
- ByteStreamGeometryContext.cs
- ConfigXmlDocument.cs
- TextDecoration.cs
- EntityContainerAssociationSet.cs
- LambdaCompiler.Address.cs
- CopyNodeSetAction.cs
- WebControlAdapter.cs
- XPathDocumentNavigator.cs
- COM2ExtendedUITypeEditor.cs
- IdentitySection.cs
- SiteMapSection.cs
- HttpDictionary.cs
- SiteMapDataSource.cs
- DataBoundControlAdapter.cs
- UnsafeMethods.cs
- EntityDataSourceDataSelectionPanel.designer.cs
- VisualBasicReference.cs
- relpropertyhelper.cs
- KerberosRequestorSecurityToken.cs
- PropertiesTab.cs
- ParenthesizePropertyNameAttribute.cs
- ReadOnlyHierarchicalDataSource.cs
- OutputCacheProviderCollection.cs
- Int32Converter.cs
- DataListItem.cs
- DataGridViewColumnEventArgs.cs
- TreeBuilderXamlTranslator.cs
- RNGCryptoServiceProvider.cs
- CalendarButtonAutomationPeer.cs
- StaticFileHandler.cs
- DataGridViewComboBoxEditingControl.cs
- InternalControlCollection.cs
- ScriptBehaviorDescriptor.cs
- KeyedCollection.cs
- SystemBrushes.cs
- BrowserTree.cs
- ZipIOCentralDirectoryBlock.cs
- ConversionContext.cs
- TableAutomationPeer.cs
- DefaultObjectMappingItemCollection.cs
- DataContractSerializerMessageContractImporter.cs
- StructuredCompositeActivityDesigner.cs
- Schema.cs
- CookielessHelper.cs
- ListParaClient.cs
- DataGridViewAdvancedBorderStyle.cs
- TdsRecordBufferSetter.cs
- HealthMonitoringSectionHelper.cs
- XamlBuildTaskServices.cs
- RealProxy.cs
- AnnotationResourceCollection.cs
- Socket.cs
- BasePropertyDescriptor.cs
- ToolboxItemImageConverter.cs
- Trace.cs
- MediaContext.cs
- HwndSource.cs
- PiiTraceSource.cs
- XPathMultyIterator.cs
- ItemPager.cs
- XmlNamespaceMappingCollection.cs
- MethodInfo.cs
- EnvironmentPermission.cs
- ImageKeyConverter.cs
- XmlAnyAttributeAttribute.cs
- BasicKeyConstraint.cs
- Font.cs
- DataGridColumnHeaderCollection.cs
- LocalFileSettingsProvider.cs
- XPathAncestorIterator.cs
- LoadRetryHandler.cs
- Oid.cs
- _StreamFramer.cs
- BitmapEffectGroup.cs
- BaseConfigurationRecord.cs
- GlyphingCache.cs
- SimpleWorkerRequest.cs
- DataControlLinkButton.cs
- SqlDependency.cs
- SqlRetyper.cs
- MsmqHostedTransportConfiguration.cs
- ArrayTypeMismatchException.cs
- NavigateEvent.cs
- LinqDataSourceDeleteEventArgs.cs
- ControlCommandSet.cs
- FieldBuilder.cs