Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Security / Cryptography / SHA1CryptoServiceProvider.cs / 1 / 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 { private SafeHashHandle _safeHashHandle = null; // // public constructors // public SHA1CryptoServiceProvider() { SafeHashHandle safeHashHandle = SafeHashHandle.InvalidHandle; // _CreateHash will check for failures and throw the appropriate exception Utils._CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1, ref safeHashHandle); _safeHashHandle = safeHashHandle; } protected override void Dispose(bool disposing) { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); // call the base class's Dispose base.Dispose(disposing); } // // public methods // public override void Initialize() { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); SafeHashHandle safeHashHandle = SafeHashHandle.InvalidHandle; // _CreateHash will check for failures and throw the appropriate exception Utils._CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1, ref safeHashHandle); _safeHashHandle = safeHashHandle; } protected override void HashCore(byte[] rgb, int ibStart, int cbSize) { Utils._HashData(_safeHashHandle, rgb, ibStart, cbSize); } protected override byte[] HashFinal() { return Utils._EndHash(_safeHashHandle); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TripleDES.cs
- Rect3D.cs
- ServiceHttpModule.cs
- backend.cs
- FlowDocumentPage.cs
- DetailsViewRowCollection.cs
- CroppedBitmap.cs
- HttpWebRequest.cs
- OracleDateTime.cs
- SizeConverter.cs
- ItemList.cs
- PieceDirectory.cs
- base64Transforms.cs
- BevelBitmapEffect.cs
- MethodBody.cs
- HasCopySemanticsAttribute.cs
- Speller.cs
- FlowDocumentPage.cs
- JsonWriter.cs
- RepeatButton.cs
- controlskin.cs
- PageCatalogPart.cs
- UiaCoreProviderApi.cs
- BoolExpressionVisitors.cs
- PointCollection.cs
- BooleanToVisibilityConverter.cs
- EdmProperty.cs
- NestedContainer.cs
- CriticalHandle.cs
- Line.cs
- SchemaRegistration.cs
- SingletonChannelAcceptor.cs
- FamilyMap.cs
- WebPartPersonalization.cs
- EmptyWithCancelationCheckWorkItem.cs
- PartialCachingAttribute.cs
- Sentence.cs
- UIElement.cs
- DispatchWrapper.cs
- CssStyleCollection.cs
- PersistChildrenAttribute.cs
- CustomSignedXml.cs
- TabItem.cs
- WebRequestModulesSection.cs
- PropertyReferenceSerializer.cs
- LOSFormatter.cs
- EnumerableCollectionView.cs
- ProgressBarHighlightConverter.cs
- EntityDataSourceEntitySetNameItem.cs
- ManipulationCompletedEventArgs.cs
- DataObject.cs
- ToolBarButton.cs
- XmlSchemaComplexContent.cs
- SqlProviderManifest.cs
- TempEnvironment.cs
- ListenerUnsafeNativeMethods.cs
- SaveWorkflowCommand.cs
- AxHost.cs
- PasswordRecovery.cs
- XappLauncher.cs
- ProfileSettings.cs
- ResourcePermissionBase.cs
- ProfileSettingsCollection.cs
- TimeSpanStorage.cs
- ResourceSetExpression.cs
- BindStream.cs
- SelectionBorderGlyph.cs
- SchemaImporterExtension.cs
- ColorMatrix.cs
- TextLine.cs
- ProcessInfo.cs
- ToolStripStatusLabel.cs
- HostSecurityManager.cs
- PathParser.cs
- Simplifier.cs
- RequestResizeEvent.cs
- SocketElement.cs
- TextMarkerSource.cs
- LoggedException.cs
- ProviderIncompatibleException.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- ParseHttpDate.cs
- SelectionEditor.cs
- InheritablePropertyChangeInfo.cs
- SoapException.cs
- StylusButton.cs
- EmptyCollection.cs
- _NestedMultipleAsyncResult.cs
- DataSourceControlBuilder.cs
- StreamResourceInfo.cs
- SystemFonts.cs
- PrimitiveList.cs
- CheckedPointers.cs
- MethodToken.cs
- DesignerObjectListAdapter.cs
- CompoundFileIOPermission.cs
- TreeWalker.cs
- XmlWriterTraceListener.cs
- KeyBinding.cs
- TypeConverterHelper.cs