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
- DBBindings.cs
- BitmapEffectRenderDataResource.cs
- AbsoluteQuery.cs
- UpDownBaseDesigner.cs
- ConfigurationLoaderException.cs
- DelegatingTypeDescriptionProvider.cs
- Dictionary.cs
- ComponentDispatcher.cs
- CodeTypeReferenceCollection.cs
- DataBoundControl.cs
- ClientFormsIdentity.cs
- PtsCache.cs
- UserControl.cs
- PasswordRecovery.cs
- ViewKeyConstraint.cs
- DynamicResourceExtension.cs
- KnownBoxes.cs
- ProfileInfo.cs
- ControlValuePropertyAttribute.cs
- TypeUnloadedException.cs
- ResXDataNode.cs
- GreenMethods.cs
- ScalarType.cs
- PerformanceCounterManager.cs
- Utils.cs
- XmlSchemaSearchPattern.cs
- DocobjHost.cs
- RoleGroup.cs
- ActiveXSite.cs
- RSAOAEPKeyExchangeDeformatter.cs
- MarkupProperty.cs
- DropDownButton.cs
- InstanceOwner.cs
- CanonicalizationDriver.cs
- QuaternionAnimation.cs
- TextProperties.cs
- Context.cs
- StrokeCollection2.cs
- NumericUpDown.cs
- TickBar.cs
- UnSafeCharBuffer.cs
- StatusBar.cs
- ColorTransformHelper.cs
- BitmapEffectDrawing.cs
- SessionStateItemCollection.cs
- MissingMethodException.cs
- CatalogPartChrome.cs
- COAUTHINFO.cs
- X509ImageLogo.cs
- RectAnimationClockResource.cs
- FixedSOMImage.cs
- FixedTextView.cs
- Rijndael.cs
- DiscoveryOperationContextExtension.cs
- DbConvert.cs
- shaperfactoryquerycacheentry.cs
- CellRelation.cs
- FragmentNavigationEventArgs.cs
- KeyConstraint.cs
- IDQuery.cs
- FlowLayout.cs
- DictionaryBase.cs
- QilBinary.cs
- ProcessManager.cs
- HashAlgorithm.cs
- BordersPage.cs
- RewritingPass.cs
- ChtmlTextWriter.cs
- CodeCatchClauseCollection.cs
- BitmapSourceSafeMILHandle.cs
- TreeViewEvent.cs
- PersonalizationEntry.cs
- FilterInvalidBodyAccessException.cs
- RequestCachePolicy.cs
- EntityTransaction.cs
- ReadWriteObjectLock.cs
- TextEditorThreadLocalStore.cs
- ListView.cs
- ToolBar.cs
- DiagnosticStrings.cs
- OracleInternalConnection.cs
- RawStylusInputCustomDataList.cs
- HttpChannelBindingToken.cs
- BindingOperations.cs
- ProcessModule.cs
- MergeLocalizationDirectives.cs
- FormViewModeEventArgs.cs
- WebPartZoneCollection.cs
- PartialArray.cs
- CodeDelegateCreateExpression.cs
- PeerNameRecordCollection.cs
- PathNode.cs
- MTConfigUtil.cs
- CodeCompiler.cs
- Errors.cs
- CommandLibraryHelper.cs
- Label.cs
- CompositeFontFamily.cs
- x509store.cs
- SqlClientWrapperSmiStream.cs