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
- InheritedPropertyChangedEventArgs.cs
- QueryOutputWriter.cs
- MenuCommandsChangedEventArgs.cs
- ControlValuePropertyAttribute.cs
- ImageIndexConverter.cs
- KeyedHashAlgorithm.cs
- CodeAttributeDeclaration.cs
- Html32TextWriter.cs
- Connector.xaml.cs
- SequenceQuery.cs
- Help.cs
- DataReaderContainer.cs
- SafeNativeMethods.cs
- ToolStripSystemRenderer.cs
- AppDomainResourcePerfCounters.cs
- SoapAttributeAttribute.cs
- BooleanExpr.cs
- ReachVisualSerializerAsync.cs
- TypeConstant.cs
- CapabilitiesRule.cs
- MsmqInputSessionChannel.cs
- Documentation.cs
- ChildTable.cs
- WebResourceAttribute.cs
- StoreAnnotationsMap.cs
- SafeWaitHandle.cs
- SQLInt64.cs
- DynamicResourceExtension.cs
- ConstrainedDataObject.cs
- ResourceManagerWrapper.cs
- VerificationAttribute.cs
- FrameworkElement.cs
- GridViewCommandEventArgs.cs
- XmlCustomFormatter.cs
- AppLevelCompilationSectionCache.cs
- TextServicesDisplayAttribute.cs
- UnmanagedBitmapWrapper.cs
- AssemblyAssociatedContentFileAttribute.cs
- MessageRpc.cs
- ListViewUpdatedEventArgs.cs
- ServicesExceptionNotHandledEventArgs.cs
- _ConnectOverlappedAsyncResult.cs
- ProcessMessagesAsyncResult.cs
- RadioButtonList.cs
- RegexCapture.cs
- RuntimeConfigLKG.cs
- CollectionBase.cs
- MemberInitExpression.cs
- Rect3D.cs
- ConnectionManager.cs
- COM2TypeInfoProcessor.cs
- BrushValueSerializer.cs
- CopyAction.cs
- PropertyToken.cs
- DecimalStorage.cs
- UpdateCompiler.cs
- AtlasWeb.Designer.cs
- GradientStop.cs
- DesignerRegionMouseEventArgs.cs
- KeyedCollection.cs
- XmlILOptimizerVisitor.cs
- ResourceDisplayNameAttribute.cs
- StandardOleMarshalObject.cs
- Assembly.cs
- SocketCache.cs
- WindowPattern.cs
- ImageField.cs
- AudioFormatConverter.cs
- Span.cs
- FocusWithinProperty.cs
- AppDomainShutdownMonitor.cs
- CacheDependency.cs
- ExpressionLexer.cs
- MaskedTextProvider.cs
- Domain.cs
- HttpVersion.cs
- EntityContainerRelationshipSet.cs
- ConsumerConnectionPoint.cs
- OleDbFactory.cs
- AudienceUriMode.cs
- MenuItemBindingCollection.cs
- CodeCastExpression.cs
- MessageEncoder.cs
- Cursor.cs
- WebBrowserBase.cs
- BitmapMetadata.cs
- OptionalMessageQuery.cs
- Nullable.cs
- ReadonlyMessageFilter.cs
- CodeDomLoader.cs
- LineSegment.cs
- ControlIdConverter.cs
- TopClause.cs
- TogglePattern.cs
- MulticastOption.cs
- GeneralTransformGroup.cs
- ConnectionOrientedTransportChannelFactory.cs
- Lasso.cs
- TCPListener.cs
- PerfCounters.cs