Code:
/ FX-1434 / FX-1434 / 1.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
- StatementContext.cs
- ConstructorExpr.cs
- AnnotationHighlightLayer.cs
- BlurBitmapEffect.cs
- MessageDecoder.cs
- RelationshipSet.cs
- DataConnectionHelper.cs
- ExtensionSimplifierMarkupObject.cs
- HeaderUtility.cs
- ContractValidationHelper.cs
- RoutedPropertyChangedEventArgs.cs
- WorkItem.cs
- EntityDataSourceContextCreatedEventArgs.cs
- RowBinding.cs
- ObjectDataSource.cs
- PerformanceCounterPermissionEntryCollection.cs
- CultureTableRecord.cs
- ProviderBase.cs
- XmlSignatureManifest.cs
- PolicyChain.cs
- PaintValueEventArgs.cs
- SafeBitVector32.cs
- PropertyTabChangedEvent.cs
- CellQuery.cs
- InternalPermissions.cs
- IndexingContentUnit.cs
- DesignBindingPropertyDescriptor.cs
- RTLAwareMessageBox.cs
- OdbcTransaction.cs
- FlowDocumentView.cs
- ToolstripProfessionalRenderer.cs
- Metadata.cs
- CalloutQueueItem.cs
- ToolStripDropDownClosingEventArgs.cs
- MainMenu.cs
- SystemFonts.cs
- AssemblyFilter.cs
- Transaction.cs
- RemotingServices.cs
- UpWmlPageAdapter.cs
- DBCSCodePageEncoding.cs
- UIElementCollection.cs
- DataTemplate.cs
- ToolZone.cs
- DocumentDesigner.cs
- LowerCaseStringConverter.cs
- FixedSOMImage.cs
- ServiceContractAttribute.cs
- BindingCompleteEventArgs.cs
- CodeDomLoader.cs
- Figure.cs
- DocumentViewerBase.cs
- ObjectDisposedException.cs
- DesignerLoader.cs
- FirewallWrapper.cs
- SignatureConfirmationElement.cs
- StoryFragments.cs
- DataControlImageButton.cs
- URI.cs
- DesignerCategoryAttribute.cs
- ReflectionTypeLoadException.cs
- WindowsListViewScroll.cs
- CodeDomSerializerException.cs
- ActivityIdHeader.cs
- ReaderOutput.cs
- WebPartVerbCollection.cs
- ClientData.cs
- ToolStripDropTargetManager.cs
- ControlPropertyNameConverter.cs
- ControlIdConverter.cs
- ComponentConverter.cs
- oledbmetadatacolumnnames.cs
- TemplateBindingExtensionConverter.cs
- DropSourceBehavior.cs
- EdmError.cs
- SafeProcessHandle.cs
- HttpAsyncResult.cs
- DataTableReaderListener.cs
- selecteditemcollection.cs
- SqlBooleanizer.cs
- Calendar.cs
- MissingMemberException.cs
- embossbitmapeffect.cs
- VBIdentifierDesigner.xaml.cs
- EventToken.cs
- ColorInterpolationModeValidation.cs
- ProgressiveCrcCalculatingStream.cs
- WorkflowRuntimeEndpoint.cs
- loginstatus.cs
- SqlTriggerContext.cs
- XLinq.cs
- Binding.cs
- MemberCollection.cs
- WebProxyScriptElement.cs
- DelegateHelpers.Generated.cs
- ParseNumbers.cs
- TracedNativeMethods.cs
- DataFormat.cs
- ResolveCriteriaCD1.cs
- SmtpFailedRecipientException.cs