Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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
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
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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlClientWrapperSmiStream.cs
- SessionPageStatePersister.cs
- WmlObjectListAdapter.cs
- handlecollector.cs
- WsdlBuildProvider.cs
- ReadOnlyDataSource.cs
- RequiredFieldValidator.cs
- DataGridCaption.cs
- Barrier.cs
- XmlObjectSerializerWriteContextComplex.cs
- DynamicMethod.cs
- mongolianshape.cs
- NavigationCommands.cs
- Parameter.cs
- BinaryFormatterWriter.cs
- HostingEnvironmentSection.cs
- BindingGraph.cs
- HandleCollector.cs
- ControlBuilderAttribute.cs
- TraceContext.cs
- WebConfigurationManager.cs
- coordinatorfactory.cs
- Memoizer.cs
- EditorBrowsableAttribute.cs
- BrowserCapabilitiesFactoryBase.cs
- Point3DConverter.cs
- _HelperAsyncResults.cs
- CompiledQuery.cs
- CodeFieldReferenceExpression.cs
- InputLanguageProfileNotifySink.cs
- PngBitmapEncoder.cs
- CapabilitiesUse.cs
- StringDictionaryWithComparer.cs
- HtmlControlPersistable.cs
- SmiEventSink_Default.cs
- PassportAuthenticationEventArgs.cs
- SqlUnionizer.cs
- IntegrationExceptionEventArgs.cs
- ScriptManager.cs
- OleDbReferenceCollection.cs
- ConnectionOrientedTransportElement.cs
- ColumnCollectionEditor.cs
- Model3DCollection.cs
- WebPartZoneBaseDesigner.cs
- ISO2022Encoding.cs
- TableChangeProcessor.cs
- StringUtil.cs
- Section.cs
- IPGlobalProperties.cs
- DeferredSelectedIndexReference.cs
- ButtonBase.cs
- grammarelement.cs
- FrameworkElementAutomationPeer.cs
- DbProviderFactory.cs
- ControlUtil.cs
- ExpressionLexer.cs
- PasswordTextNavigator.cs
- ResolveDuplexCD1AsyncResult.cs
- OutputCacheSettings.cs
- WebPartDisplayModeCollection.cs
- PluralizationServiceUtil.cs
- GetLedgerEntryForRecipientRequest.cs
- DependsOnAttribute.cs
- sortedlist.cs
- AsymmetricSignatureFormatter.cs
- Trace.cs
- SiteMapNodeItem.cs
- FloaterBaseParaClient.cs
- FixedPageStructure.cs
- DataGridTableCollection.cs
- TextTreeUndo.cs
- DataGridViewColumnHeaderCell.cs
- StorageModelBuildProvider.cs
- Animatable.cs
- Crypto.cs
- ExpressionEditorSheet.cs
- SqlBulkCopyColumnMapping.cs
- X509Chain.cs
- GridEntryCollection.cs
- AxisAngleRotation3D.cs
- XmlSchemaObjectCollection.cs
- SqlTriggerContext.cs
- ProfileService.cs
- DesignColumnCollection.cs
- EntitySqlQueryCacheEntry.cs
- SHA1CryptoServiceProvider.cs
- PageParser.cs
- ServiceDescriptionImporter.cs
- ItemCheckEvent.cs
- Compiler.cs
- ProfileSection.cs
- ValidationError.cs
- SymmetricAlgorithm.cs
- Margins.cs
- XmlElement.cs
- ConnectionOrientedTransportChannelFactory.cs
- GenericsInstances.cs
- _CookieModule.cs
- AsyncResult.cs
- Pair.cs