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
- ErrorFormatter.cs
- BulletedListEventArgs.cs
- sapiproxy.cs
- OdbcCommand.cs
- DesignBinding.cs
- ChildTable.cs
- JsonByteArrayDataContract.cs
- HttpGetProtocolReflector.cs
- NamedPipeAppDomainProtocolHandler.cs
- ToolStripCollectionEditor.cs
- ParentUndoUnit.cs
- FrameworkElement.cs
- StickyNoteContentControl.cs
- MailMessage.cs
- CurrentChangingEventArgs.cs
- DbDataRecord.cs
- DefaultDialogButtons.cs
- Positioning.cs
- TdsParser.cs
- EncoderNLS.cs
- CreateUserWizardDesigner.cs
- NativeMethods.cs
- GradientStopCollection.cs
- DatasetMethodGenerator.cs
- TabPage.cs
- SingleTagSectionHandler.cs
- Slider.cs
- WebPartMenuStyle.cs
- PartitionedStreamMerger.cs
- CodeMethodReturnStatement.cs
- SqlFormatter.cs
- FlowDocumentFormatter.cs
- PriorityRange.cs
- XmlReaderSettings.cs
- EnumValidator.cs
- AttributeData.cs
- Region.cs
- Debugger.cs
- OuterGlowBitmapEffect.cs
- AutoResetEvent.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- SoapParser.cs
- AttachmentCollection.cs
- InlineUIContainer.cs
- ApplicationActivator.cs
- XmlQueryTypeFactory.cs
- DbInsertCommandTree.cs
- OutputCacheSection.cs
- DesignerOptionService.cs
- BitmapMetadataEnumerator.cs
- Compilation.cs
- FieldCollectionEditor.cs
- Privilege.cs
- SqlComparer.cs
- EventLogger.cs
- HeaderedItemsControl.cs
- DataPointer.cs
- PerformanceCounterManager.cs
- HealthMonitoringSectionHelper.cs
- Html32TextWriter.cs
- ContentPropertyAttribute.cs
- TaskExceptionHolder.cs
- DictionaryEditChange.cs
- BuildProviderUtils.cs
- FunctionQuery.cs
- TextViewSelectionProcessor.cs
- CodeTypeDelegate.cs
- SQLBoolean.cs
- Style.cs
- FixedFindEngine.cs
- BadImageFormatException.cs
- EventProxy.cs
- PolyBezierSegment.cs
- OrderPreservingPipeliningSpoolingTask.cs
- UdpChannelFactory.cs
- DeclarativeCatalogPart.cs
- TextRunCache.cs
- BitmapEffect.cs
- Message.cs
- controlskin.cs
- XamlWriter.cs
- IndexingContentUnit.cs
- ContainerVisual.cs
- QuinticEase.cs
- ViewGenerator.cs
- TreeNodeCollection.cs
- Base64Stream.cs
- JoinElimination.cs
- MetadataItemSerializer.cs
- RangeBase.cs
- Tile.cs
- Style.cs
- CharacterBuffer.cs
- ScrollData.cs
- DictionaryMarkupSerializer.cs
- GridViewRowPresenter.cs
- ToolStripSeparatorRenderEventArgs.cs
- FixedTextContainer.cs
- Label.cs
- WebPartZone.cs