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
- XmlDataLoader.cs
- DeclarationUpdate.cs
- ItemList.cs
- ColumnBinding.cs
- Attributes.cs
- CursorInteropHelper.cs
- ListViewInsertedEventArgs.cs
- SqlCacheDependencyDatabase.cs
- EncoderParameters.cs
- UserInitiatedNavigationPermission.cs
- CommandExpr.cs
- CompositionTarget.cs
- ToolTipService.cs
- ColumnTypeConverter.cs
- Selector.cs
- MenuItemStyleCollection.cs
- HandlerFactoryCache.cs
- columnmapkeybuilder.cs
- ProxyRpc.cs
- StaticFileHandler.cs
- ReliableMessagingHelpers.cs
- BufferedWebEventProvider.cs
- OrthographicCamera.cs
- ListCollectionView.cs
- TimelineGroup.cs
- HttpContext.cs
- HtmlTableCellCollection.cs
- PointAnimationUsingPath.cs
- ISCIIEncoding.cs
- ThemeDictionaryExtension.cs
- Line.cs
- _DisconnectOverlappedAsyncResult.cs
- IApplicationTrustManager.cs
- AuthenticationSection.cs
- SHA512CryptoServiceProvider.cs
- ProtocolsSection.cs
- Grid.cs
- DbConnectionPoolOptions.cs
- SQLSingleStorage.cs
- ExtensibleClassFactory.cs
- RuleSettingsCollection.cs
- WeakEventTable.cs
- DiscardableAttribute.cs
- NetworkInformationException.cs
- ConfigPathUtility.cs
- FontFamilyValueSerializer.cs
- SimpleType.cs
- SmtpTransport.cs
- QueryOperationResponseOfT.cs
- PageWrapper.cs
- baseaxisquery.cs
- ExtractedStateEntry.cs
- UmAlQuraCalendar.cs
- XmlTextEncoder.cs
- WindowsSolidBrush.cs
- RawMouseInputReport.cs
- InternalPolicyElement.cs
- ObjectQueryExecutionPlan.cs
- ValueCollectionParameterReader.cs
- SoapTransportImporter.cs
- DataGridViewCellCollection.cs
- DataGridViewEditingControlShowingEventArgs.cs
- TreeNodeBindingCollection.cs
- OrderedDictionary.cs
- XmlTextReaderImplHelpers.cs
- ILGen.cs
- IPPacketInformation.cs
- PathTooLongException.cs
- SatelliteContractVersionAttribute.cs
- CfgParser.cs
- StorageFunctionMapping.cs
- AsyncOperationManager.cs
- GetRecipientRequest.cs
- HitTestResult.cs
- NavigateUrlConverter.cs
- OletxEnlistment.cs
- SafeUserTokenHandle.cs
- Decorator.cs
- EdmTypeAttribute.cs
- DataGridViewDataErrorEventArgs.cs
- TraceContextRecord.cs
- PaperSource.cs
- SimpleRecyclingCache.cs
- InputScopeAttribute.cs
- SocketInformation.cs
- ConfigPathUtility.cs
- ISAPIRuntime.cs
- RegexCharClass.cs
- FaultImportOptions.cs
- ApplyImportsAction.cs
- PreviewPageInfo.cs
- SqlGenericUtil.cs
- FontFamilyIdentifier.cs
- IISUnsafeMethods.cs
- EncryptedPackageFilter.cs
- ListViewTableRow.cs
- IgnoreFileBuildProvider.cs
- SafeBitVector32.cs
- PropertyEntry.cs
- BookmarkWorkItem.cs