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
- XmlHelper.cs
- EllipseGeometry.cs
- MultiPageTextView.cs
- TextCompositionManager.cs
- CodeIndexerExpression.cs
- TypeBuilder.cs
- WSHttpBinding.cs
- CheckableControlBaseAdapter.cs
- XmlQueryStaticData.cs
- FixedSOMContainer.cs
- WebPartTracker.cs
- FileController.cs
- MsmqMessageSerializationFormat.cs
- Process.cs
- CFStream.cs
- ExtensionSimplifierMarkupObject.cs
- CodeDirectiveCollection.cs
- FunctionDescription.cs
- HttpConfigurationContext.cs
- ScrollBar.cs
- SafeNativeMethods.cs
- TextTreeDeleteContentUndoUnit.cs
- RegionInfo.cs
- WindowsStatic.cs
- DataStreamFromComStream.cs
- DesignObjectWrapper.cs
- TextParagraphProperties.cs
- ContentType.cs
- TextDecoration.cs
- Lasso.cs
- SoapExtension.cs
- PasswordDeriveBytes.cs
- FlowSwitchDesigner.xaml.cs
- TypeUsageBuilder.cs
- SimpleMailWebEventProvider.cs
- ManagementEventWatcher.cs
- ExceptionUtility.cs
- SqlExpressionNullability.cs
- HostingPreferredMapPath.cs
- ServiceChannel.cs
- DomNameTable.cs
- MenuAdapter.cs
- CaseInsensitiveOrdinalStringComparer.cs
- VBCodeProvider.cs
- SspiWrapper.cs
- CaseCqlBlock.cs
- CertificateManager.cs
- RefreshEventArgs.cs
- SigningCredentials.cs
- HttpServerProtocol.cs
- CatalogZoneBase.cs
- DesignerUtils.cs
- ResolveMatchesMessage11.cs
- MemoryStream.cs
- DocumentAutomationPeer.cs
- InfoCardTrace.cs
- DbgUtil.cs
- DataContractSerializerServiceBehavior.cs
- WindowsToolbarItemAsMenuItem.cs
- MiniMapControl.xaml.cs
- ListBoxItemWrapperAutomationPeer.cs
- XmlCustomFormatter.cs
- cache.cs
- GenericIdentity.cs
- InheritanceContextHelper.cs
- InternalMappingException.cs
- WindowsGraphics2.cs
- ApplicationInfo.cs
- URLIdentityPermission.cs
- SqlMethodTransformer.cs
- FileDataSourceCache.cs
- EventLog.cs
- CommandManager.cs
- BaseCAMarshaler.cs
- UserControlParser.cs
- EditorResources.cs
- BevelBitmapEffect.cs
- HitTestWithGeometryDrawingContextWalker.cs
- altserialization.cs
- MarkupCompilePass1.cs
- Types.cs
- SQLStringStorage.cs
- ArrayExtension.cs
- ImageSourceValueSerializer.cs
- ResourceExpressionBuilder.cs
- DataTableExtensions.cs
- Point3DAnimationBase.cs
- ListBoxItem.cs
- MarshalDirectiveException.cs
- ApplicationBuildProvider.cs
- DataError.cs
- ServiceSecurityAuditBehavior.cs
- FolderNameEditor.cs
- PackagePartCollection.cs
- ShutDownListener.cs
- Vector3DCollection.cs
- VisualStyleInformation.cs
- ContextDataSourceContextData.cs
- Mapping.cs
- autovalidator.cs