Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- FormatConvertedBitmap.cs
- SerializationException.cs
- HotCommands.cs
- DocumentViewerBaseAutomationPeer.cs
- NetPeerTcpBinding.cs
- DataObjectEventArgs.cs
- EntitySetBase.cs
- PathTooLongException.cs
- ToolStripHighContrastRenderer.cs
- NullReferenceException.cs
- CaseCqlBlock.cs
- Environment.cs
- Model3DGroup.cs
- BooleanFacetDescriptionElement.cs
- _IPv4Address.cs
- PropertyCollection.cs
- latinshape.cs
- TemplateBindingExtension.cs
- SynchronizationContext.cs
- CharacterBufferReference.cs
- Attributes.cs
- EdmValidator.cs
- XmlElementAttribute.cs
- CellLabel.cs
- UniqueIdentifierService.cs
- TextRangeEdit.cs
- AstNode.cs
- GZipStream.cs
- AccessDataSourceView.cs
- RichTextBoxAutomationPeer.cs
- UnsafeNativeMethods.cs
- SoapAttributeAttribute.cs
- Wizard.cs
- PropertyInfoSet.cs
- FileUtil.cs
- PointUtil.cs
- ExportOptions.cs
- dataSvcMapFileLoader.cs
- QuaternionAnimation.cs
- WindowsHyperlink.cs
- DtdParser.cs
- TypeDescriptorFilterService.cs
- CompiledQuery.cs
- EmptyStringExpandableObjectConverter.cs
- XPathNavigatorReader.cs
- Stackframe.cs
- DllHostInitializer.cs
- XmlDesigner.cs
- SqlDataSourceQueryEditorForm.cs
- StatusBarPanel.cs
- BitmapEffectCollection.cs
- ChannelSinkStacks.cs
- Assembly.cs
- SecurityContextTokenValidationException.cs
- CollectionChangedEventManager.cs
- Crypto.cs
- MSAAEventDispatcher.cs
- FragmentQueryKB.cs
- DataGridViewCellStyleBuilderDialog.cs
- FormsAuthentication.cs
- XmlElementList.cs
- XmlFormatExtensionPrefixAttribute.cs
- ResetableIterator.cs
- NetCodeGroup.cs
- Repeater.cs
- _ContextAwareResult.cs
- TargetParameterCountException.cs
- DATA_BLOB.cs
- DictionaryMarkupSerializer.cs
- TargetControlTypeAttribute.cs
- QueryPageSettingsEventArgs.cs
- ObsoleteAttribute.cs
- SingleSelectRootGridEntry.cs
- Hashtable.cs
- AutomationElementCollection.cs
- TableLayoutPanel.cs
- SmuggledIUnknown.cs
- CaseInsensitiveComparer.cs
- GorillaCodec.cs
- RevocationPoint.cs
- InvalidWMPVersionException.cs
- Int32CAMarshaler.cs
- VisualStateManager.cs
- ToolStripGripRenderEventArgs.cs
- ResourceExpression.cs
- SQLInt16Storage.cs
- SchemaImporter.cs
- COM2ICategorizePropertiesHandler.cs
- PropertyItemInternal.cs
- IncrementalReadDecoders.cs
- AttributedMetaModel.cs
- OptimalTextSource.cs
- Int16Animation.cs
- TaskFormBase.cs
- LinearGradientBrush.cs
- DiscreteKeyFrames.cs
- MutableAssemblyCacheEntry.cs
- TraceLevelStore.cs
- FeatureSupport.cs
- Calendar.cs