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
- TransactionChannelListener.cs
- ConfigXmlAttribute.cs
- FileCodeGroup.cs
- StaticFileHandler.cs
- ExpressionBuilderContext.cs
- ZoneIdentityPermission.cs
- SerialErrors.cs
- AutomationPatternInfo.cs
- Constant.cs
- ExpandoObject.cs
- CacheModeConverter.cs
- ConnectionProviderAttribute.cs
- PageResolution.cs
- SetStoryboardSpeedRatio.cs
- CultureTableRecord.cs
- EncryptedData.cs
- StateFinalizationActivity.cs
- KeyValuePairs.cs
- XmlMapping.cs
- XmlNodeList.cs
- ReceiveMessageRecord.cs
- RangeValidator.cs
- ContentWrapperAttribute.cs
- ParenthesizePropertyNameAttribute.cs
- NameTable.cs
- CompositeActivityCodeGenerator.cs
- EnumMember.cs
- NetworkCredential.cs
- AuthorizationRuleCollection.cs
- RoutedEventHandlerInfo.cs
- CollaborationHelperFunctions.cs
- Expander.cs
- XmlWriterSettings.cs
- Token.cs
- ApplicationTrust.cs
- ServiceCredentialsSecurityTokenManager.cs
- CheckableControlBaseAdapter.cs
- InkCanvas.cs
- Composition.cs
- BCryptSafeHandles.cs
- RoleManagerEventArgs.cs
- FeatureManager.cs
- ChannelEndpointElementCollection.cs
- TemplateInstanceAttribute.cs
- DataObject.cs
- TargetControlTypeCache.cs
- TreeViewImageKeyConverter.cs
- sqlnorm.cs
- SqlTriggerAttribute.cs
- SvcMapFileSerializer.cs
- BrowserInteropHelper.cs
- Accessible.cs
- HostingPreferredMapPath.cs
- _NestedSingleAsyncResult.cs
- SystemColors.cs
- StandardRuntimeEnumValidator.cs
- MarkupWriter.cs
- ContainerVisual.cs
- FileCodeGroup.cs
- ViewKeyConstraint.cs
- ProcessModelInfo.cs
- ModelTreeEnumerator.cs
- AxDesigner.cs
- ConfigurationException.cs
- XsltCompileContext.cs
- QueryOutputWriter.cs
- TypeName.cs
- FilterableAttribute.cs
- ProfileBuildProvider.cs
- CookielessHelper.cs
- ListDictionary.cs
- ClientBuildManager.cs
- MetadataArtifactLoaderFile.cs
- SymDocumentType.cs
- BuilderPropertyEntry.cs
- BitmapDownload.cs
- XmlSchemaSimpleContent.cs
- StreamReader.cs
- NestedContainer.cs
- ClientSettingsSection.cs
- ListView.cs
- SettingsSavedEventArgs.cs
- ContentPlaceHolder.cs
- RemotingConfigParser.cs
- MobileTemplatedControlDesigner.cs
- Pen.cs
- WmlObjectListAdapter.cs
- BindingsSection.cs
- DataGridAutomationPeer.cs
- AdornerHitTestResult.cs
- PathGeometry.cs
- Size.cs
- GroupQuery.cs
- ActivationServices.cs
- EventListener.cs
- MSAAEventDispatcher.cs
- MiniConstructorInfo.cs
- SystemIcmpV4Statistics.cs
- ISCIIEncoding.cs
- LambdaCompiler.Binary.cs