Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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); } } } // 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 { 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); } } } // 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
- ParallelEnumerableWrapper.cs
- CallSiteOps.cs
- CategoryGridEntry.cs
- ContractAdapter.cs
- XmlNodeReader.cs
- EntityDataSourceSelectingEventArgs.cs
- BitmapMetadataBlob.cs
- DomainUpDown.cs
- BitmapEffectDrawing.cs
- HtmlShim.cs
- MDIClient.cs
- MonitoringDescriptionAttribute.cs
- ISAPIRuntime.cs
- GlyphInfoList.cs
- DocumentApplicationJournalEntry.cs
- PolyBezierSegment.cs
- FormParameter.cs
- X509InitiatorCertificateServiceElement.cs
- PropertyTabAttribute.cs
- RuntimeVariableList.cs
- ProxyHwnd.cs
- EdmComplexPropertyAttribute.cs
- FormClosedEvent.cs
- SqlConnectionPoolProviderInfo.cs
- MdiWindowListStrip.cs
- InputMethodStateTypeInfo.cs
- StoreItemCollection.cs
- AddingNewEventArgs.cs
- ResourceDescriptionAttribute.cs
- ToolStripDropTargetManager.cs
- EntityViewGenerator.cs
- BatchWriter.cs
- GridViewColumn.cs
- QilXmlWriter.cs
- HttpHandlerActionCollection.cs
- QueryPageSettingsEventArgs.cs
- SqlBuffer.cs
- MenuAdapter.cs
- BinaryKeyIdentifierClause.cs
- TreeViewEvent.cs
- SymmetricAlgorithm.cs
- CallSite.cs
- complextypematerializer.cs
- ApplicationSecurityManager.cs
- QuaternionAnimation.cs
- SspiNegotiationTokenProvider.cs
- CheckedListBox.cs
- TopClause.cs
- SqlDataSourceCustomCommandPanel.cs
- AnnotationStore.cs
- ToolStripOverflow.cs
- NumericUpDown.cs
- MediaContext.cs
- Hex.cs
- GenericAuthenticationEventArgs.cs
- WeakReferenceEnumerator.cs
- UpWmlPageAdapter.cs
- AuthorizationContext.cs
- Hash.cs
- ValidatorAttribute.cs
- BorderSidesEditor.cs
- Int16AnimationUsingKeyFrames.cs
- Array.cs
- DbConnectionPoolIdentity.cs
- securitycriticaldataformultiplegetandset.cs
- FunctionNode.cs
- AssemblyInfo.cs
- ContextMenuAutomationPeer.cs
- HitTestParameters.cs
- DebugView.cs
- GPPOINT.cs
- ExtendedProtectionPolicy.cs
- BasicHttpBindingCollectionElement.cs
- DataProtection.cs
- ComPlusServiceLoader.cs
- DataGridViewLinkCell.cs
- ToggleButton.cs
- BitmapVisualManager.cs
- DataGridViewCellValueEventArgs.cs
- DmlSqlGenerator.cs
- DesignerForm.cs
- ControlType.cs
- Line.cs
- HyperlinkAutomationPeer.cs
- PersistChildrenAttribute.cs
- connectionpool.cs
- ReadOnlyObservableCollection.cs
- DocumentGridContextMenu.cs
- LabelAutomationPeer.cs
- HtmlDocument.cs
- EventLog.cs
- DataTemplateSelector.cs
- StructuralObject.cs
- DefaultTraceListener.cs
- ListViewSelectEventArgs.cs
- OracleParameterBinding.cs
- NativeCppClassAttribute.cs
- ContextQuery.cs
- StrongNameKeyPair.cs
- FrameDimension.cs