Code:
/ FX-1434 / FX-1434 / 1.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
- UIElementParaClient.cs
- PhysicalOps.cs
- DnsEndpointIdentity.cs
- ToolboxComponentsCreatedEventArgs.cs
- PropertyEmitterBase.cs
- StreamReader.cs
- AmbientLight.cs
- HuffCodec.cs
- AstTree.cs
- DateTimeValueSerializer.cs
- DocumentGrid.cs
- JournalEntryListConverter.cs
- GcHandle.cs
- ObjectToIdCache.cs
- TreeViewImageIndexConverter.cs
- DataRowComparer.cs
- StandardCommandToolStripMenuItem.cs
- DbConnectionStringCommon.cs
- SplitterPanel.cs
- SafeProcessHandle.cs
- ContentPresenter.cs
- PagesChangedEventArgs.cs
- BindableAttribute.cs
- ListSortDescription.cs
- BitmapSourceSafeMILHandle.cs
- FormViewModeEventArgs.cs
- objectquery_tresulttype.cs
- PointLight.cs
- WaitForChangedResult.cs
- TimeSpanParse.cs
- CompiledRegexRunner.cs
- QilInvoke.cs
- InternalBufferOverflowException.cs
- ErrorFormatterPage.cs
- VariableAction.cs
- EmptyControlCollection.cs
- ActivityDesignerResources.cs
- odbcmetadatacollectionnames.cs
- AmbiguousMatchException.cs
- ManagedWndProcTracker.cs
- ASCIIEncoding.cs
- ProxyElement.cs
- ImplicitInputBrush.cs
- RTTrackingProfile.cs
- EntityException.cs
- ObjectReaderCompiler.cs
- ConstrainedDataObject.cs
- DataServiceQueryOfT.cs
- NonBatchDirectoryCompiler.cs
- MediaEntryAttribute.cs
- SecurityKeyType.cs
- Util.cs
- PrintingPermission.cs
- FixedSOMPageElement.cs
- OpacityConverter.cs
- SqlNodeAnnotation.cs
- HtmlControl.cs
- CodeStatementCollection.cs
- WebPartMovingEventArgs.cs
- OuterGlowBitmapEffect.cs
- Scene3D.cs
- SecurityPolicySection.cs
- ModulesEntry.cs
- ToolBarPanel.cs
- PtsCache.cs
- VirtualizedItemProviderWrapper.cs
- DataDesignUtil.cs
- HttpProcessUtility.cs
- RepeaterItemEventArgs.cs
- PropertyMetadata.cs
- ConnectionPoint.cs
- SqlClientPermission.cs
- TextProperties.cs
- connectionpool.cs
- TextAutomationPeer.cs
- XmlElementAttribute.cs
- HandleRef.cs
- QuadraticBezierSegment.cs
- NameScope.cs
- TempFiles.cs
- SHA384.cs
- RenderOptions.cs
- X509RawDataKeyIdentifierClause.cs
- PageHandlerFactory.cs
- MD5HashHelper.cs
- xmlsaver.cs
- TreeViewItemAutomationPeer.cs
- SmiXetterAccessMap.cs
- XmlILConstructAnalyzer.cs
- PrivilegedConfigurationManager.cs
- UpdateTranslator.cs
- WindowVisualStateTracker.cs
- ComboBox.cs
- MarkupCompilePass1.cs
- WebHttpBindingElement.cs
- SourceFilter.cs
- TextLineBreak.cs
- QuotedPrintableStream.cs
- Pointer.cs
- ParsedAttributeCollection.cs