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
- StringValueSerializer.cs
- EnvelopeVersion.cs
- SafeSystemMetrics.cs
- XsltFunctions.cs
- UInt32Storage.cs
- Byte.cs
- TypedElement.cs
- PkcsMisc.cs
- BitSet.cs
- HostedNamedPipeTransportManager.cs
- OpCodes.cs
- PageCache.cs
- PageAdapter.cs
- JoinQueryOperator.cs
- OperationFormatStyle.cs
- CodeDelegateInvokeExpression.cs
- ProjectedWrapper.cs
- CmsInterop.cs
- StateWorkerRequest.cs
- MergeFilterQuery.cs
- SqlPersonalizationProvider.cs
- WinFormsSecurity.cs
- XPathExpr.cs
- xmlsaver.cs
- DataGridPageChangedEventArgs.cs
- ZipQueryOperator.cs
- DetailsViewInsertedEventArgs.cs
- QuadTree.cs
- PropertyGridEditorPart.cs
- DataSourceControlBuilder.cs
- Matrix3DConverter.cs
- InstanceStoreQueryResult.cs
- StoryFragments.cs
- AsyncResult.cs
- TextParagraph.cs
- EventLogPermissionEntry.cs
- CheckBox.cs
- ToolStripTextBox.cs
- DataGridRowAutomationPeer.cs
- ClientApiGenerator.cs
- GenericPrincipal.cs
- DependencyPropertyDescriptor.cs
- DockingAttribute.cs
- AutoResetEvent.cs
- SqlNodeAnnotations.cs
- InternalCache.cs
- DetailsViewCommandEventArgs.cs
- CorePropertiesFilter.cs
- MenuItemStyle.cs
- Help.cs
- MSAAEventDispatcher.cs
- ChangeNode.cs
- ProvideValueServiceProvider.cs
- UIElementHelper.cs
- FlowDocumentView.cs
- MsmqIntegrationInputMessage.cs
- StrokeDescriptor.cs
- ExpressionSelection.cs
- HttpConfigurationContext.cs
- SiteMapPath.cs
- CollectionTraceRecord.cs
- XmlMemberMapping.cs
- AsymmetricSignatureDeformatter.cs
- NativeMethods.cs
- RectAnimationClockResource.cs
- Model3DGroup.cs
- SocketInformation.cs
- XmlSchema.cs
- DbMetaDataCollectionNames.cs
- MdiWindowListStrip.cs
- CompoundFileIOPermission.cs
- GeneralTransform3DGroup.cs
- BinaryFormatter.cs
- XsltContext.cs
- CheckBox.cs
- Underline.cs
- DeviceContext2.cs
- XmlStringTable.cs
- WebPartExportVerb.cs
- ObjectQuery.cs
- OLEDB_Util.cs
- HtmlInputText.cs
- SHA256.cs
- CurrencyWrapper.cs
- CoreSwitches.cs
- LeaseManager.cs
- DictionaryBase.cs
- HtmlFormWrapper.cs
- NavigationCommands.cs
- SafeProcessHandle.cs
- ProviderMetadata.cs
- Int32CollectionValueSerializer.cs
- WinFormsUtils.cs
- WebBrowserEvent.cs
- ProfilePropertySettingsCollection.cs
- DataTableTypeConverter.cs
- PasswordBox.cs
- EnumMember.cs
- HierarchicalDataSourceControl.cs
- TextShapeableCharacters.cs