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
- CategoryNameCollection.cs
- StringWriter.cs
- XmlUtil.cs
- SystemGatewayIPAddressInformation.cs
- XmlNamespaceDeclarationsAttribute.cs
- DescriptionAttribute.cs
- GiveFeedbackEventArgs.cs
- ProtectedProviderSettings.cs
- DataSourceControl.cs
- VerticalConnector.xaml.cs
- CfgParser.cs
- SchemaCollectionPreprocessor.cs
- linebase.cs
- _BufferOffsetSize.cs
- LoggedException.cs
- Misc.cs
- XpsFilter.cs
- PropertyEmitterBase.cs
- XmlSchemaElement.cs
- WebPartEditorCancelVerb.cs
- RecommendedAsConfigurableAttribute.cs
- InstanceCreationEditor.cs
- ProfileSection.cs
- SiteOfOriginContainer.cs
- BroadcastEventHelper.cs
- WebReferenceOptions.cs
- TextEditorCopyPaste.cs
- StaticResourceExtension.cs
- BidOverLoads.cs
- CreatingCookieEventArgs.cs
- ResourceAttributes.cs
- WebPartEventArgs.cs
- ReachBasicContext.cs
- HierarchicalDataBoundControl.cs
- ToolStripMenuItem.cs
- XmlAnyElementAttribute.cs
- GZipObjectSerializer.cs
- WebAdminConfigurationHelper.cs
- FlowDocument.cs
- HttpRawResponse.cs
- Int32Rect.cs
- FaultDescriptionCollection.cs
- ProtocolsConfiguration.cs
- DetectRunnableInstancesTask.cs
- FullTrustAssembly.cs
- ProcessingInstructionAction.cs
- DataContractJsonSerializer.cs
- DelegateCompletionCallbackWrapper.cs
- StringUtil.cs
- Base64Encoding.cs
- DocumentViewer.cs
- ImageField.cs
- ExpressionBuilder.cs
- TextRangeBase.cs
- _NegoState.cs
- Selector.cs
- ColorMap.cs
- RectangleF.cs
- AssertUtility.cs
- TrustSection.cs
- Matrix.cs
- DesignerAttribute.cs
- Section.cs
- SqlProfileProvider.cs
- PlaceHolder.cs
- Size3D.cs
- SuspendDesigner.cs
- HttpServerVarsCollection.cs
- ListViewItem.cs
- QuaternionKeyFrameCollection.cs
- RadioButtonFlatAdapter.cs
- CodeChecksumPragma.cs
- SevenBitStream.cs
- SQLByte.cs
- PointLight.cs
- ActivationArguments.cs
- SecurityCriticalDataForSet.cs
- XmlElementList.cs
- MultiTrigger.cs
- HwndPanningFeedback.cs
- AssertSection.cs
- ZipIOCentralDirectoryBlock.cs
- TrustLevel.cs
- ReadOnlyCollectionBuilder.cs
- SecurityMode.cs
- ScriptingProfileServiceSection.cs
- IncrementalReadDecoders.cs
- FreeIndexList.cs
- ProtectedConfigurationSection.cs
- Transform3DCollection.cs
- MenuItem.cs
- QueryOptionExpression.cs
- SoapInteropTypes.cs
- DbUpdateCommandTree.cs
- AutomationPropertyInfo.cs
- PeerNameRecord.cs
- StylusPointPropertyInfo.cs
- SafeNativeMethods.cs
- EventArgs.cs
- BigInt.cs