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
- SecurityContext.cs
- CompilerWrapper.cs
- LogConverter.cs
- Path.cs
- graph.cs
- Vector3DAnimationUsingKeyFrames.cs
- KerberosSecurityTokenProvider.cs
- ViewService.cs
- Crypto.cs
- AuthenticationServiceManager.cs
- ToolStripDropDownItem.cs
- TableLayoutCellPaintEventArgs.cs
- WebDescriptionAttribute.cs
- Instrumentation.cs
- VisualTreeUtils.cs
- RoleGroup.cs
- SqlUdtInfo.cs
- AffineTransform3D.cs
- FormViewInsertEventArgs.cs
- TableCellCollection.cs
- NotifyInputEventArgs.cs
- WebBrowserUriTypeConverter.cs
- ColorMatrix.cs
- CachedBitmap.cs
- Style.cs
- AuthenticatedStream.cs
- StrokeCollectionDefaultValueFactory.cs
- BitmapEffectInputData.cs
- StrongNameHelpers.cs
- ContractType.cs
- UdpChannelListener.cs
- ExtendLockCommand.cs
- StorageBasedPackageProperties.cs
- TextMetrics.cs
- HotSpot.cs
- LifetimeServices.cs
- LostFocusEventManager.cs
- FlowDocumentFormatter.cs
- ClickablePoint.cs
- PasswordTextNavigator.cs
- DictionarySurrogate.cs
- WindowsListViewGroup.cs
- BufferBuilder.cs
- BuildManagerHost.cs
- StateRuntime.cs
- XmlNamedNodeMap.cs
- PageOutputQuality.cs
- OracleInternalConnection.cs
- BaseCAMarshaler.cs
- ResourceSet.cs
- ConfigurationPropertyCollection.cs
- sqlcontext.cs
- HierarchicalDataSourceControl.cs
- PageRequestManager.cs
- PrimitiveType.cs
- ContentElement.cs
- KeyConverter.cs
- Collection.cs
- MultiSelectRootGridEntry.cs
- HiddenFieldPageStatePersister.cs
- StringArrayEditor.cs
- EndOfStreamException.cs
- IndexOutOfRangeException.cs
- XmlSchemas.cs
- SchemeSettingElementCollection.cs
- ApplicationServiceHelper.cs
- Comparer.cs
- CollectionDataContractAttribute.cs
- CacheChildrenQuery.cs
- ReadonlyMessageFilter.cs
- BlockExpression.cs
- SqlWebEventProvider.cs
- XmlIlVisitor.cs
- XmlSchemaComplexType.cs
- ListSortDescriptionCollection.cs
- OleDbCommand.cs
- TemplatePagerField.cs
- ViewBase.cs
- ModulesEntry.cs
- WebResourceUtil.cs
- BindingContext.cs
- CookieHandler.cs
- State.cs
- DatagridviewDisplayedBandsData.cs
- SafeBitVector32.cs
- XmlSchemaComplexContentRestriction.cs
- MarkupWriter.cs
- CanonicalFormWriter.cs
- FileDialogCustomPlace.cs
- CapabilitiesSection.cs
- unsafenativemethodstextservices.cs
- DynamicValidatorEventArgs.cs
- QueryContinueDragEventArgs.cs
- DateTimePicker.cs
- ActivationWorker.cs
- StyleSelector.cs
- ReflectTypeDescriptionProvider.cs
- CompilerErrorCollection.cs
- DoWhileDesigner.xaml.cs
- HostedTransportConfigurationManager.cs