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
- _NegotiateClient.cs
- SetIterators.cs
- SQLRoleProvider.cs
- GetWorkflowTree.cs
- DataGridViewAccessibleObject.cs
- MetafileHeaderWmf.cs
- DSASignatureFormatter.cs
- WebPartAuthorizationEventArgs.cs
- TrustManagerPromptUI.cs
- SymbolEqualComparer.cs
- StringFormat.cs
- RowUpdatingEventArgs.cs
- DeliveryStrategy.cs
- TextInfo.cs
- ReflectionUtil.cs
- CodePropertyReferenceExpression.cs
- AsymmetricKeyExchangeFormatter.cs
- Pair.cs
- SiteMapSection.cs
- DiagnosticSection.cs
- GeometryConverter.cs
- QualificationDataAttribute.cs
- XmlUnspecifiedAttribute.cs
- ViewManager.cs
- SystemTcpStatistics.cs
- DependencyPropertyConverter.cs
- BaseValidator.cs
- EnvironmentPermission.cs
- FixedStringLookup.cs
- DocumentScope.cs
- SupportsEventValidationAttribute.cs
- OracleConnectionFactory.cs
- Package.cs
- DaylightTime.cs
- BidOverLoads.cs
- BitmapEffectDrawingContextState.cs
- SocketInformation.cs
- PeerToPeerException.cs
- RuleSetBrowserDialog.cs
- MessageSmuggler.cs
- EdmItemCollection.cs
- DataGridViewTopRowAccessibleObject.cs
- GridLength.cs
- ClientTarget.cs
- SystemInfo.cs
- XmlSchemaAttribute.cs
- DataGridViewBindingCompleteEventArgs.cs
- WindowsPen.cs
- ActiveDocumentEvent.cs
- ErrorStyle.cs
- Rect.cs
- MimeTypeMapper.cs
- LinqDataSourceValidationException.cs
- ConnectionStringsExpressionEditor.cs
- IConvertible.cs
- DispatcherTimer.cs
- RotationValidation.cs
- LambdaCompiler.Binary.cs
- ObjectViewEntityCollectionData.cs
- XmlBaseReader.cs
- LinqExpressionNormalizer.cs
- RayHitTestParameters.cs
- OracleConnectionFactory.cs
- DebugView.cs
- SafeCryptoKeyHandle.cs
- TemplateControlBuildProvider.cs
- AssemblyBuilderData.cs
- ExecutedRoutedEventArgs.cs
- PlainXmlSerializer.cs
- ThrowOnMultipleAssignment.cs
- GradientBrush.cs
- ExpressionBinding.cs
- ObjectDataSourceWizardForm.cs
- XamlPoint3DCollectionSerializer.cs
- ClientFormsIdentity.cs
- RoleBoolean.cs
- SqlReorderer.cs
- XmlSchemaType.cs
- MessageCredentialType.cs
- MultipleViewPattern.cs
- JavascriptCallbackBehaviorAttribute.cs
- remotingproxy.cs
- Keyboard.cs
- ViewGenResults.cs
- BufferModesCollection.cs
- TargetInvocationException.cs
- Blend.cs
- EmptyControlCollection.cs
- FolderNameEditor.cs
- XPathDocumentIterator.cs
- XmlSchemaAnnotation.cs
- TransactionContext.cs
- DesignBindingPropertyDescriptor.cs
- PageBreakRecord.cs
- MulticastOption.cs
- DataGridViewCellStyleConverter.cs
- ArrayHelper.cs
- IApplicationTrustManager.cs
- EditCommandColumn.cs
- SingleAnimationUsingKeyFrames.cs