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
- ProjectionPruner.cs
- TransactionProtocol.cs
- StandardOleMarshalObject.cs
- COSERVERINFO.cs
- CaseCqlBlock.cs
- PropertyEmitterBase.cs
- PrivateFontCollection.cs
- AbandonedMutexException.cs
- MessageContractAttribute.cs
- SqlBooleanMismatchVisitor.cs
- DataGridViewComboBoxCell.cs
- PtsCache.cs
- DelegateSerializationHolder.cs
- ObjectListCommandsPage.cs
- CommonGetThemePartSize.cs
- JsonFormatGeneratorStatics.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- _SecureChannel.cs
- MethodRental.cs
- ConnectionPoolManager.cs
- WorkflowQueue.cs
- BitmapEffectGeneralTransform.cs
- EmptyTextWriter.cs
- XsltCompileContext.cs
- NativeMethodsOther.cs
- SymLanguageVendor.cs
- IOException.cs
- MediaPlayerState.cs
- ReversePositionQuery.cs
- Vector3DCollection.cs
- SafeNativeMethodsCLR.cs
- httpserverutility.cs
- CompositeDataBoundControl.cs
- UIElementAutomationPeer.cs
- UserNameSecurityToken.cs
- MSAAWinEventWrap.cs
- ObjectMemberMapping.cs
- SoapMessage.cs
- ResourcePermissionBaseEntry.cs
- AxisAngleRotation3D.cs
- CompoundFileIOPermission.cs
- SuppressMergeCheckAttribute.cs
- InstancePersistenceException.cs
- SourceFileInfo.cs
- ContentPlaceHolder.cs
- ObjectNavigationPropertyMapping.cs
- PenContexts.cs
- StylusCollection.cs
- RuleRefElement.cs
- XmlSchemaSimpleTypeUnion.cs
- ClientTargetCollection.cs
- CharAnimationBase.cs
- VectorConverter.cs
- SafeHandles.cs
- QilDataSource.cs
- DataContractAttribute.cs
- TextSegment.cs
- DiscoveryDocumentLinksPattern.cs
- WizardPanel.cs
- SqlOuterApplyReducer.cs
- FixedStringLookup.cs
- DataSetMappper.cs
- BufferedReadStream.cs
- Path.cs
- WrapPanel.cs
- DoubleCollectionValueSerializer.cs
- Binding.cs
- CustomMenuItemCollection.cs
- SqlServer2KCompatibilityCheck.cs
- UIPropertyMetadata.cs
- ButtonAutomationPeer.cs
- DataGridViewLinkColumn.cs
- LayeredChannelFactory.cs
- HtmlInputButton.cs
- EventLogPropertySelector.cs
- BitmapEncoder.cs
- XmlSchemaAttributeGroup.cs
- SingleStorage.cs
- DbXmlEnabledProviderManifest.cs
- WindowsGraphicsCacheManager.cs
- DBDataPermissionAttribute.cs
- EventWaitHandle.cs
- baseaxisquery.cs
- ClaimComparer.cs
- MetadataStore.cs
- FreezableCollection.cs
- XmlBoundElement.cs
- InkCanvasSelection.cs
- HostProtectionPermission.cs
- RootCodeDomSerializer.cs
- EdmFunctionAttribute.cs
- TypeSystem.cs
- MediaContext.cs
- MethodBody.cs
- QuotedPrintableStream.cs
- CompareInfo.cs
- TextEditorDragDrop.cs
- TextEffectResolver.cs
- WebBrowserNavigatingEventHandler.cs
- FixUp.cs