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
- WebPartCloseVerb.cs
- HttpWebRequestElement.cs
- TableHeaderCell.cs
- EndpointAddressProcessor.cs
- ControlValuePropertyAttribute.cs
- Button.cs
- DesignerDataView.cs
- DocumentViewerConstants.cs
- DesignerProperties.cs
- mda.cs
- RenamedEventArgs.cs
- X509SecurityTokenProvider.cs
- RegistrationServices.cs
- XmlNodeReader.cs
- CrossContextChannel.cs
- SystemResources.cs
- OleDbTransaction.cs
- SponsorHelper.cs
- MenuEventArgs.cs
- SiteOfOriginContainer.cs
- ToolStripPanel.cs
- CompositeCollection.cs
- PreProcessInputEventArgs.cs
- OleDbPropertySetGuid.cs
- KeyboardNavigation.cs
- XmlImplementation.cs
- Compiler.cs
- ContentDisposition.cs
- FileBasedResourceGroveler.cs
- AudioDeviceOut.cs
- ListViewHitTestInfo.cs
- OleDbFactory.cs
- RtfFormatStack.cs
- SizeConverter.cs
- BamlLocalizableResourceKey.cs
- FieldAccessException.cs
- XmlSchemaAttributeGroup.cs
- BitmapPalettes.cs
- WindowsFormsHost.cs
- EntityDataSourceReferenceGroup.cs
- remotingproxy.cs
- LineBreakRecord.cs
- StateDesigner.CommentLayoutGlyph.cs
- NavigationEventArgs.cs
- InternalsVisibleToAttribute.cs
- httpserverutility.cs
- GeometryGroup.cs
- CallbackWrapper.cs
- AssemblyAttributes.cs
- SymDocumentType.cs
- DeclarationUpdate.cs
- Conditional.cs
- XamlVector3DCollectionSerializer.cs
- TextProviderWrapper.cs
- TraceContextEventArgs.cs
- ListViewItem.cs
- XslTransform.cs
- AuthorizationContext.cs
- COSERVERINFO.cs
- MachinePropertyVariants.cs
- TypefaceMetricsCache.cs
- UrlAuthFailedErrorFormatter.cs
- CommentAction.cs
- WindowsListViewGroupHelper.cs
- PersonalizationStateInfo.cs
- UnsafeNativeMethods.cs
- HttpPostProtocolImporter.cs
- ValueTable.cs
- ToolStripSettings.cs
- ChannelServices.cs
- ScriptingRoleServiceSection.cs
- ExtendedProtectionPolicy.cs
- DrawListViewSubItemEventArgs.cs
- InputLanguageProfileNotifySink.cs
- LogReserveAndAppendState.cs
- LassoSelectionBehavior.cs
- HostedController.cs
- ToolStripPanel.cs
- ProxyElement.cs
- ProviderException.cs
- EventSetter.cs
- DataKey.cs
- FloaterBaseParagraph.cs
- InternalTransaction.cs
- TextFindEngine.cs
- Argument.cs
- ServiceModelConfigurationSectionCollection.cs
- IsolationInterop.cs
- SubclassTypeValidator.cs
- ToolStripSplitButton.cs
- MultipartIdentifier.cs
- Lease.cs
- HtmlInputImage.cs
- EncodingDataItem.cs
- RuntimeWrappedException.cs
- CultureInfoConverter.cs
- Empty.cs
- MenuItem.cs
- InvalidCastException.cs
- PropertySet.cs