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
- SubMenuStyleCollection.cs
- TextRange.cs
- NativeWrapper.cs
- GeneralTransform2DTo3DTo2D.cs
- ProcessModule.cs
- EpmCustomContentDeSerializer.cs
- PhysicalOps.cs
- SubqueryTrackingVisitor.cs
- ElementNotAvailableException.cs
- DbConnectionPoolGroup.cs
- Property.cs
- TextRangeProviderWrapper.cs
- DataGridViewAdvancedBorderStyle.cs
- WebColorConverter.cs
- Point3DAnimation.cs
- HTMLTextWriter.cs
- RuntimeConfigLKG.cs
- DropShadowEffect.cs
- ConfigXmlAttribute.cs
- ActivityPreviewDesigner.cs
- ScriptServiceAttribute.cs
- SetterBase.cs
- InfoCardMetadataExchangeClient.cs
- AssertValidation.cs
- SqlDataSourceSelectingEventArgs.cs
- HtmlToClrEventProxy.cs
- Journal.cs
- FontWeight.cs
- BooleanConverter.cs
- DropShadowBitmapEffect.cs
- ToolStripSplitStackLayout.cs
- SqlFunctionAttribute.cs
- X509ChainPolicy.cs
- ThreadExceptionEvent.cs
- ListItemConverter.cs
- CacheVirtualItemsEvent.cs
- sortedlist.cs
- CaseCqlBlock.cs
- ManipulationStartedEventArgs.cs
- SafeRegistryHandle.cs
- EtwTrace.cs
- PopupControlService.cs
- OracleException.cs
- _SslState.cs
- ResolvedKeyFrameEntry.cs
- PatternMatchRules.cs
- DefaultMemberAttribute.cs
- UnsignedPublishLicense.cs
- FontInfo.cs
- PropertyDescriptor.cs
- XmlILTrace.cs
- X509CertificateCollection.cs
- Attachment.cs
- Mappings.cs
- DrawListViewColumnHeaderEventArgs.cs
- Single.cs
- EditingMode.cs
- ObjectDataSourceSelectingEventArgs.cs
- MatrixKeyFrameCollection.cs
- DependencyObjectProvider.cs
- BezierSegment.cs
- ProfileParameter.cs
- EdmComplexTypeAttribute.cs
- FolderBrowserDialog.cs
- MemberDomainMap.cs
- SystemResources.cs
- SignatureToken.cs
- DataPagerFieldCommandEventArgs.cs
- EDesignUtil.cs
- DefaultValueConverter.cs
- MethodBuilderInstantiation.cs
- TdsParserStateObject.cs
- CatalogPartCollection.cs
- CapabilitiesState.cs
- TaskExtensions.cs
- ExpandCollapseProviderWrapper.cs
- ByeMessageCD1.cs
- SQLInt32.cs
- DesignerWithHeader.cs
- BitmapEffect.cs
- tooltip.cs
- Pair.cs
- MessageEncoder.cs
- SynchronizationContext.cs
- TextTreeRootTextBlock.cs
- AddressAlreadyInUseException.cs
- DataGridHelper.cs
- Event.cs
- XPathSingletonIterator.cs
- WSTrustFeb2005.cs
- Size.cs
- DataObjectEventArgs.cs
- ToolBar.cs
- PrintDialog.cs
- RawMouseInputReport.cs
- CSharpCodeProvider.cs
- CodeIdentifier.cs
- DataIdProcessor.cs
- ServiceModelEnumValidator.cs
- DynamicResourceExtension.cs