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
- WebPartExportVerb.cs
- OdbcError.cs
- WizardStepBase.cs
- DataControlPagerLinkButton.cs
- LoadRetryConstantStrategy.cs
- LiteralDesigner.cs
- AuthorizationSection.cs
- OwnerDrawPropertyBag.cs
- HtmlElement.cs
- OperatingSystemVersionCheck.cs
- DataGridToolTip.cs
- XmlSchemaAnyAttribute.cs
- Divide.cs
- FlatButtonAppearance.cs
- WindowsListViewItemStartMenu.cs
- ModelServiceImpl.cs
- SqlGenericUtil.cs
- GetWinFXPath.cs
- XamlSerializer.cs
- AndCondition.cs
- PrintingPermissionAttribute.cs
- XmlSerializableReader.cs
- CodeCompiler.cs
- Storyboard.cs
- SmiTypedGetterSetter.cs
- BitmapEncoder.cs
- KeyValuePair.cs
- Single.cs
- SecurityPermission.cs
- WmlPhoneCallAdapter.cs
- ScalarRestriction.cs
- AssemblyHash.cs
- StyleTypedPropertyAttribute.cs
- CryptographicAttribute.cs
- ServiceSecurityAuditElement.cs
- OdbcReferenceCollection.cs
- FileSecurity.cs
- StatusStrip.cs
- InvalidPropValue.cs
- SplitterPanel.cs
- DesignTimeTemplateParser.cs
- EndpointDiscoveryMetadataCD1.cs
- ThrowOnMultipleAssignment.cs
- ProfileGroupSettings.cs
- ResourceReferenceExpressionConverter.cs
- AssemblyBuilder.cs
- BaseConfigurationRecord.cs
- AlternateViewCollection.cs
- SafePEFileHandle.cs
- CallbackTimeoutsBehavior.cs
- IndexerNameAttribute.cs
- WasEndpointConfigContainer.cs
- GlyphTypeface.cs
- EntityType.cs
- XmlDataDocument.cs
- HttpWriter.cs
- WindowsComboBox.cs
- ScriptManager.cs
- WebServiceResponseDesigner.cs
- QilParameter.cs
- EnumDataContract.cs
- StrongNameIdentityPermission.cs
- WasEndpointConfigContainer.cs
- ProgressBarBrushConverter.cs
- CallInfo.cs
- StateRuntime.cs
- RepeatBehavior.cs
- ObjectParameter.cs
- TypeDescriptorFilterService.cs
- ReadOnlyPermissionSet.cs
- CellPartitioner.cs
- TypedRowHandler.cs
- ValueType.cs
- PenThread.cs
- HttpVersion.cs
- XmlSchemaAny.cs
- CryptoSession.cs
- RoutedEventHandlerInfo.cs
- PageHandlerFactory.cs
- CodeCompileUnit.cs
- TextProviderWrapper.cs
- CodeNamespaceCollection.cs
- UniqueID.cs
- Separator.cs
- References.cs
- SetState.cs
- StringFormat.cs
- EntityDataSourceColumn.cs
- CounterSample.cs
- TraceSection.cs
- EntityCommandExecutionException.cs
- DataListCommandEventArgs.cs
- Double.cs
- EditorAttributeInfo.cs
- Trace.cs
- TreeWalkHelper.cs
- DefaultValueConverter.cs
- TrustManagerPromptUI.cs
- DocumentSchemaValidator.cs
- FunctionDescription.cs