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
- ImageAnimator.cs
- EdmRelationshipRoleAttribute.cs
- ExtendedTransformFactory.cs
- AssociatedControlConverter.cs
- mansign.cs
- NativeMethods.cs
- AlgoModule.cs
- ClientUrlResolverWrapper.cs
- DataGridViewCellCollection.cs
- ResourceExpression.cs
- DocumentViewerAutomationPeer.cs
- handlecollector.cs
- SemanticResultKey.cs
- PropertyGridView.cs
- Drawing.cs
- DataControlField.cs
- AsymmetricSignatureDeformatter.cs
- ComponentDispatcherThread.cs
- RequestTimeoutManager.cs
- PreProcessInputEventArgs.cs
- SystemInfo.cs
- ToolStripCollectionEditor.cs
- CurrencyManager.cs
- FormClosedEvent.cs
- SqlXml.cs
- AppDomainCompilerProxy.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- ResolveDuplexAsyncResult.cs
- DataGridViewCellPaintingEventArgs.cs
- MenuItemCollection.cs
- GatewayDefinition.cs
- WorkflowMarkupSerializationManager.cs
- SspiNegotiationTokenProviderState.cs
- RequestStatusBarUpdateEventArgs.cs
- Canonicalizers.cs
- TreeView.cs
- HighlightVisual.cs
- RemoteArgument.cs
- SpecialFolderEnumConverter.cs
- Int32Storage.cs
- IgnorePropertiesAttribute.cs
- ButtonBase.cs
- Slider.cs
- BStrWrapper.cs
- EtwTrackingBehaviorElement.cs
- ObjectStateManagerMetadata.cs
- DbUpdateCommandTree.cs
- SamlSecurityToken.cs
- DataIdProcessor.cs
- EdmConstants.cs
- RawStylusActions.cs
- ThreadInterruptedException.cs
- ClientBuildManager.cs
- UIElement3D.cs
- PropertyMapper.cs
- XmlSchemaAll.cs
- XhtmlTextWriter.cs
- NumericExpr.cs
- ReadOnlyHierarchicalDataSource.cs
- Range.cs
- Control.cs
- ConfigXmlReader.cs
- ArrayMergeHelper.cs
- XmlSortKey.cs
- Events.cs
- CollectionsUtil.cs
- ByteKeyFrameCollection.cs
- EntityCommandCompilationException.cs
- ColumnHeaderConverter.cs
- ReadOnlyTernaryTree.cs
- TranslateTransform.cs
- ChildTable.cs
- VisualProxy.cs
- ComboBoxDesigner.cs
- ScriptModule.cs
- DataProtection.cs
- RemotingServices.cs
- ContentDesigner.cs
- MetadataCache.cs
- StandardOleMarshalObject.cs
- WebColorConverter.cs
- ChangeBlockUndoRecord.cs
- BooleanFunctions.cs
- PasswordBoxAutomationPeer.cs
- TextServicesManager.cs
- FormViewRow.cs
- SdlChannelSink.cs
- TabControlEvent.cs
- Binding.cs
- MessageSecurityTokenVersion.cs
- TdsRecordBufferSetter.cs
- IsolatedStorageException.cs
- AudioSignalProblemOccurredEventArgs.cs
- UnknownBitmapEncoder.cs
- GuidTagList.cs
- Token.cs
- PolicyValidationException.cs
- BinaryObjectReader.cs
- SecureUICommand.cs
- DbConnectionPoolGroupProviderInfo.cs