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
- Visual3DCollection.cs
- Ray3DHitTestResult.cs
- RepeatBehaviorConverter.cs
- WindowsFont.cs
- DrawingState.cs
- ComContractElement.cs
- SQLDecimalStorage.cs
- NativeMethodsOther.cs
- TrackingServices.cs
- SurrogateSelector.cs
- RightsManagementPermission.cs
- precedingsibling.cs
- ICspAsymmetricAlgorithm.cs
- WebDisplayNameAttribute.cs
- IODescriptionAttribute.cs
- LineSegment.cs
- AlphaSortedEnumConverter.cs
- WinFormsComponentEditor.cs
- TextFindEngine.cs
- WmlImageAdapter.cs
- ActivationArguments.cs
- NumericPagerField.cs
- PersonalizationStateInfo.cs
- RepeaterItem.cs
- HyperLinkColumn.cs
- SessionState.cs
- CacheOutputQuery.cs
- Zone.cs
- WebPartConnectionsCancelVerb.cs
- QuinticEase.cs
- Evidence.cs
- InkCanvasAutomationPeer.cs
- TableRow.cs
- WebRequest.cs
- IsolatedStoragePermission.cs
- HtmlHead.cs
- SchemaNamespaceManager.cs
- ToolStripItemGlyph.cs
- MTConfigUtil.cs
- DateTimeValueSerializerContext.cs
- NetworkInformationPermission.cs
- TextViewBase.cs
- Graphics.cs
- OneWayElement.cs
- CookieHandler.cs
- IPGlobalProperties.cs
- VisualStyleRenderer.cs
- SequentialActivityDesigner.cs
- GridItem.cs
- SelectionRange.cs
- ExtractorMetadata.cs
- ValidateNames.cs
- XmlNamedNodeMap.cs
- EventProxy.cs
- ChangeDirector.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- DynamicValueConverter.cs
- GACIdentityPermission.cs
- OleStrCAMarshaler.cs
- DataControlImageButton.cs
- BrowsableAttribute.cs
- FilterUserControlBase.cs
- TypeLoadException.cs
- PathData.cs
- AggregateNode.cs
- XmlTextReaderImpl.cs
- Int16Converter.cs
- FullTextState.cs
- OneToOneMappingSerializer.cs
- PeerNearMe.cs
- Helper.cs
- ScaleTransform.cs
- ProxyWebPartManager.cs
- HwndMouseInputProvider.cs
- MethodBuilder.cs
- ActiveDocumentEvent.cs
- TaskbarItemInfo.cs
- DateTimeSerializationSection.cs
- TextSegment.cs
- documentsequencetextview.cs
- TileModeValidation.cs
- UInt16Storage.cs
- OrderingQueryOperator.cs
- ItemChangedEventArgs.cs
- DataStreams.cs
- WorkerProcess.cs
- SHA384Managed.cs
- SqlMetaData.cs
- Button.cs
- CompositionCommandSet.cs
- SettingsPropertyValueCollection.cs
- TCPListener.cs
- FormViewCommandEventArgs.cs
- WebBrowserNavigatedEventHandler.cs
- CodeDirectionExpression.cs
- DesignerAttribute.cs
- SvcMapFileLoader.cs
- RelationshipEndCollection.cs
- CmsUtils.cs
- ErrorFormatterPage.cs