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
- ScriptModule.cs
- WindowsGrip.cs
- WebScriptMetadataMessage.cs
- ClientSettingsStore.cs
- CheckBoxBaseAdapter.cs
- ServiceDesigner.cs
- SQLDateTime.cs
- ObjectCloneHelper.cs
- FusionWrap.cs
- ParseChildrenAsPropertiesAttribute.cs
- MDIWindowDialog.cs
- PropertySegmentSerializationProvider.cs
- TextBoxBaseDesigner.cs
- SoundPlayerAction.cs
- HtmlWindowCollection.cs
- WindowsNonControl.cs
- CheckBox.cs
- CodeGeneratorOptions.cs
- XmlHierarchyData.cs
- ServiceObjectContainer.cs
- WebRequest.cs
- WindowsGraphicsCacheManager.cs
- CustomError.cs
- ControlUtil.cs
- ConfigurationLocationCollection.cs
- AssertFilter.cs
- Attribute.cs
- ScrollItemProviderWrapper.cs
- XmlSerializerAssemblyAttribute.cs
- BitmapPalette.cs
- XmlSchemaObjectCollection.cs
- IgnoreFileBuildProvider.cs
- Encoder.cs
- ClientRuntimeConfig.cs
- RegisteredDisposeScript.cs
- SqlUtils.cs
- InputManager.cs
- XmlMemberMapping.cs
- DragDeltaEventArgs.cs
- QueryStringHandler.cs
- LinearGradientBrush.cs
- TextBox.cs
- RemotingConfiguration.cs
- DerivedKeyCachingSecurityTokenSerializer.cs
- DbCommandTree.cs
- StorageMappingItemLoader.cs
- RewritingSimplifier.cs
- DataTableMapping.cs
- Properties.cs
- SmiMetaData.cs
- EqualityComparer.cs
- OracleConnection.cs
- ZoneIdentityPermission.cs
- ZoneIdentityPermission.cs
- MdiWindowListStrip.cs
- Activity.cs
- DataGridSortCommandEventArgs.cs
- MultitargetingHelpers.cs
- DateTime.cs
- UserInitiatedNavigationPermission.cs
- Geometry3D.cs
- Error.cs
- FileChangesMonitor.cs
- GeneralTransform3DTo2DTo3D.cs
- FixedStringLookup.cs
- NullRuntimeConfig.cs
- Registry.cs
- DispatcherExceptionFilterEventArgs.cs
- CustomValidator.cs
- Menu.cs
- WhereaboutsReader.cs
- PropertyGridEditorPart.cs
- ClientConvert.cs
- RightsManagementProvider.cs
- EnumMemberAttribute.cs
- TraceContext.cs
- TransactedBatchingBehavior.cs
- TdsParserStaticMethods.cs
- PropertyEmitter.cs
- ColumnWidthChangedEvent.cs
- FragmentQueryProcessor.cs
- SchemaObjectWriter.cs
- DragCompletedEventArgs.cs
- Point3DCollection.cs
- _DomainName.cs
- ListControlBoundActionList.cs
- XmlnsDefinitionAttribute.cs
- ToolStripCodeDomSerializer.cs
- mda.cs
- SmiEventStream.cs
- Activation.cs
- ContentElementAutomationPeer.cs
- LocalizedNameDescriptionPair.cs
- COM2TypeInfoProcessor.cs
- OracleLob.cs
- SerializationException.cs
- KeyGestureValueSerializer.cs
- DocumentsTrace.cs
- AssemblyBuilder.cs
- ClientFormsAuthenticationCredentials.cs