Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- Paragraph.cs
- Oid.cs
- ThemeDirectoryCompiler.cs
- GuidTagList.cs
- DataGridViewControlCollection.cs
- ReverseInheritProperty.cs
- RequestCache.cs
- TogglePattern.cs
- UnicodeEncoding.cs
- PersonalizationStateInfo.cs
- EntityClassGenerator.cs
- QueryOutputWriter.cs
- XmlSchemaIdentityConstraint.cs
- VariableQuery.cs
- XmlDataSourceNodeDescriptor.cs
- PointAnimationUsingPath.cs
- ChannelEndpointElement.cs
- RMPublishingDialog.cs
- AppDomainFactory.cs
- ConnectionStringsExpressionEditor.cs
- OleDbEnumerator.cs
- ProcessThreadCollection.cs
- SqlCommand.cs
- OverflowException.cs
- MenuItemStyleCollection.cs
- DecimalAnimationBase.cs
- SQLDecimal.cs
- WebMessageBodyStyleHelper.cs
- NumberFunctions.cs
- ExtractorMetadata.cs
- EncoderFallback.cs
- ParameterCollection.cs
- XsltContext.cs
- PingOptions.cs
- TypeElementCollection.cs
- QueryCacheManager.cs
- Win32SafeHandles.cs
- ResXDataNode.cs
- RegistrySecurity.cs
- GeneralTransform2DTo3D.cs
- ProgressPage.cs
- CursorConverter.cs
- MinimizableAttributeTypeConverter.cs
- validationstate.cs
- TextFormatter.cs
- DataGridViewTextBoxCell.cs
- SqlConnectionStringBuilder.cs
- Helpers.cs
- TriggerAction.cs
- WebPartMinimizeVerb.cs
- DeclarativeCatalogPart.cs
- SoapEnvelopeProcessingElement.cs
- TextDecorationCollection.cs
- SiteMapDataSourceDesigner.cs
- AlignmentYValidation.cs
- RelationshipSet.cs
- SecurityCredentialsManager.cs
- SafeViewOfFileHandle.cs
- XmlSchemaAnnotation.cs
- SQLResource.cs
- DefaultEventAttribute.cs
- RestClientProxyHandler.cs
- EventDescriptorCollection.cs
- RemotingAttributes.cs
- BatchWriter.cs
- WebPartsPersonalizationAuthorization.cs
- TypedElement.cs
- ModelVisual3D.cs
- CriticalHandle.cs
- Events.cs
- ReflectionTypeLoadException.cs
- AlphabeticalEnumConverter.cs
- NotFiniteNumberException.cs
- IPHostEntry.cs
- WebPartDisplayModeCollection.cs
- _Events.cs
- ToolStripDropDownMenu.cs
- QilNode.cs
- Formatter.cs
- TextDpi.cs
- Attributes.cs
- RegisterInfo.cs
- DbProviderFactoriesConfigurationHandler.cs
- ClientRolePrincipal.cs
- ParameterModifier.cs
- HyperLinkStyle.cs
- DefaultPropertyAttribute.cs
- XPathScanner.cs
- DetailsViewUpdateEventArgs.cs
- SafeRightsManagementQueryHandle.cs
- IncrementalReadDecoders.cs
- SplitterDesigner.cs
- Constraint.cs
- XmlILModule.cs
- XPathSelfQuery.cs
- ParameterCollection.cs
- TriggerBase.cs
- Win32Native.cs
- FutureFactory.cs
- SmiMetaDataProperty.cs