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
- TemplateControlCodeDomTreeGenerator.cs
- httpapplicationstate.cs
- SimpleBitVector32.cs
- Error.cs
- CompilerResults.cs
- ClientSettings.cs
- SequentialWorkflowHeaderFooter.cs
- WebPartCatalogAddVerb.cs
- StoreContentChangedEventArgs.cs
- TargetConverter.cs
- InsufficientMemoryException.cs
- RequestCacheManager.cs
- InternalBufferOverflowException.cs
- Debugger.cs
- FormConverter.cs
- DelegateHelpers.cs
- SmiMetaDataProperty.cs
- __Filters.cs
- TextSelection.cs
- XmlSortKey.cs
- KeySplineConverter.cs
- ObjectList.cs
- EventBindingService.cs
- WrapPanel.cs
- WebBrowserSiteBase.cs
- ToolStripSeparatorRenderEventArgs.cs
- Page.cs
- Metadata.cs
- UnmanagedMarshal.cs
- ToolBarTray.cs
- PkcsMisc.cs
- SessionPageStateSection.cs
- InProcStateClientManager.cs
- FreezableCollection.cs
- ValueCollectionParameterReader.cs
- TextTreePropertyUndoUnit.cs
- ExpandCollapsePattern.cs
- EventManager.cs
- CustomSignedXml.cs
- GiveFeedbackEventArgs.cs
- TextBoxView.cs
- BinaryObjectReader.cs
- CheckPair.cs
- SpellerError.cs
- WebServiceClientProxyGenerator.cs
- WebPartConnectVerb.cs
- BitConverter.cs
- DateTimeOffsetConverter.cs
- ConsumerConnectionPointCollection.cs
- FontUnit.cs
- ContextQuery.cs
- ConfigurationFileMap.cs
- RuntimeWrappedException.cs
- ForceCopyBuildProvider.cs
- RouteParameter.cs
- ModelPropertyCollectionImpl.cs
- AdPostCacheSubstitution.cs
- ZeroOpNode.cs
- SplineKeyFrames.cs
- OutputCacheEntry.cs
- RegexCompiler.cs
- XmlRawWriterWrapper.cs
- Thread.cs
- SkipQueryOptionExpression.cs
- Validator.cs
- XmlQuerySequence.cs
- HandledMouseEvent.cs
- PersistenceTypeAttribute.cs
- OperationCanceledException.cs
- hwndwrapper.cs
- HtmlString.cs
- ObjectStateEntryDbDataRecord.cs
- ToolBar.cs
- ProxyRpc.cs
- SafeCryptoHandles.cs
- UpdateException.cs
- WsdlBuildProvider.cs
- TextBox.cs
- ActivityBindForm.cs
- LineInfo.cs
- PatternMatcher.cs
- IISMapPath.cs
- HealthMonitoringSectionHelper.cs
- ChannelServices.cs
- SynchronizationFilter.cs
- Page.cs
- TextTreeInsertElementUndoUnit.cs
- SoapFaultCodes.cs
- DirectoryNotFoundException.cs
- SqlDataRecord.cs
- EntityDescriptor.cs
- AmbientLight.cs
- ProcessHostConfigUtils.cs
- BamlBinaryReader.cs
- DESCryptoServiceProvider.cs
- WindowsFormsHostPropertyMap.cs
- OutputCacheProfile.cs
- StorageEntityTypeMapping.cs
- HttpCapabilitiesBase.cs
- WebPartConnection.cs