Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Cryptography / SHA1CryptoServiceProvider.cs / 1305376 / 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
{
[System.Security.SecurityCritical /*auto-generated*/]
private SafeHashHandle _safeHashHandle = null;
//
// public constructors
//
[System.Security.SecuritySafeCritical] // auto-generated
public SHA1CryptoServiceProvider() {
// _CreateHash will check for failures and throw the appropriate exception
_safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1);
}
[System.Security.SecuritySafeCritical] // overrides public transparent member
protected override void Dispose(bool disposing)
{
if (_safeHashHandle != null && !_safeHashHandle.IsClosed)
_safeHashHandle.Dispose();
// call the base class's Dispose
base.Dispose(disposing);
}
//
// public methods
//
[System.Security.SecuritySafeCritical] // auto-generated
public override void Initialize() {
if (_safeHashHandle != null && !_safeHashHandle.IsClosed)
_safeHashHandle.Dispose();
// _CreateHash will check for failures and throw the appropriate exception
_safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1);
}
[System.Security.SecuritySafeCritical] // overrides protected transparent member
protected override void HashCore(byte[] rgb, int ibStart, int cbSize)
{
Utils.HashData(_safeHashHandle, rgb, ibStart, cbSize);
}
[System.Security.SecuritySafeCritical] // overrides protected transparent member
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.
//
// ==--==
// [....]
//
//
// SHA1CryptoServiceProvider.cs
//
namespace System.Security.Cryptography {
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class SHA1CryptoServiceProvider : SHA1
{
[System.Security.SecurityCritical /*auto-generated*/]
private SafeHashHandle _safeHashHandle = null;
//
// public constructors
//
[System.Security.SecuritySafeCritical] // auto-generated
public SHA1CryptoServiceProvider() {
// _CreateHash will check for failures and throw the appropriate exception
_safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1);
}
[System.Security.SecuritySafeCritical] // overrides public transparent member
protected override void Dispose(bool disposing)
{
if (_safeHashHandle != null && !_safeHashHandle.IsClosed)
_safeHashHandle.Dispose();
// call the base class's Dispose
base.Dispose(disposing);
}
//
// public methods
//
[System.Security.SecuritySafeCritical] // auto-generated
public override void Initialize() {
if (_safeHashHandle != null && !_safeHashHandle.IsClosed)
_safeHashHandle.Dispose();
// _CreateHash will check for failures and throw the appropriate exception
_safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1);
}
[System.Security.SecuritySafeCritical] // overrides protected transparent member
protected override void HashCore(byte[] rgb, int ibStart, int cbSize)
{
Utils.HashData(_safeHashHandle, rgb, ibStart, cbSize);
}
[System.Security.SecuritySafeCritical] // overrides protected transparent member
protected override byte[] HashFinal()
{
return Utils.EndHash(_safeHashHandle);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EdgeProfileValidation.cs
- SettingsPropertyIsReadOnlyException.cs
- UnsafeNativeMethods.cs
- StickyNoteHelper.cs
- ValidationVisibilityAttribute.cs
- _SSPISessionCache.cs
- DeclarationUpdate.cs
- OpenFileDialog.cs
- ItemCheckedEvent.cs
- _Connection.cs
- PositiveTimeSpanValidator.cs
- SqlCacheDependencySection.cs
- FormViewDesigner.cs
- TypeGeneratedEventArgs.cs
- VisualStyleRenderer.cs
- EntityFrameworkVersions.cs
- SecurityToken.cs
- TextTabProperties.cs
- SslStreamSecurityUpgradeProvider.cs
- ToolStripSeparatorRenderEventArgs.cs
- StringExpressionSet.cs
- PreDigestedSignedInfo.cs
- ActivitySurrogate.cs
- SqlClientPermission.cs
- DesignTimeType.cs
- LabelDesigner.cs
- Literal.cs
- SessionMode.cs
- Request.cs
- DataGridViewColumnConverter.cs
- SaveFileDialogDesigner.cs
- MissingMethodException.cs
- HttpFileCollectionWrapper.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- SubMenuStyleCollection.cs
- ConfigDefinitionUpdates.cs
- GridViewDeleteEventArgs.cs
- ConstructorExpr.cs
- MethodBuilderInstantiation.cs
- Int32CAMarshaler.cs
- XmlILConstructAnalyzer.cs
- SimpleApplicationHost.cs
- WaitHandleCannotBeOpenedException.cs
- SystemColorTracker.cs
- StrongNamePublicKeyBlob.cs
- SQLInt64Storage.cs
- AudioBase.cs
- Rijndael.cs
- XmlTextEncoder.cs
- RectAnimationClockResource.cs
- ColorAnimationBase.cs
- CollectionViewSource.cs
- SchemaTableOptionalColumn.cs
- Int32Collection.cs
- EntityChangedParams.cs
- ViewStateException.cs
- Line.cs
- CqlParserHelpers.cs
- SchemaImporterExtensionsSection.cs
- ControlPaint.cs
- Buffer.cs
- FrameworkTextComposition.cs
- InputBuffer.cs
- SystemGatewayIPAddressInformation.cs
- dsa.cs
- HttpListenerException.cs
- SkewTransform.cs
- CacheOutputQuery.cs
- PeerEndPoint.cs
- MSG.cs
- StateFinalizationActivity.cs
- ProcessStartInfo.cs
- ServiceDescription.cs
- ListViewDesigner.cs
- DrawingAttributesDefaultValueFactory.cs
- odbcmetadatafactory.cs
- CatalogPart.cs
- VisualTarget.cs
- SmiContext.cs
- SelectingProviderEventArgs.cs
- OptimizerPatterns.cs
- MustUnderstandSoapException.cs
- Substitution.cs
- TemplateControlParser.cs
- DebugViewWriter.cs
- StateMachineAction.cs
- ColorAnimationUsingKeyFrames.cs
- MatrixCamera.cs
- HMACMD5.cs
- MediaSystem.cs
- WebPartRestoreVerb.cs
- SuppressMergeCheckAttribute.cs
- SystemResourceHost.cs
- PerformanceCounterManager.cs
- ResourceLoader.cs
- FindCriteria.cs
- DateTimeFormatInfo.cs
- ChangeConflicts.cs
- StorageComplexPropertyMapping.cs
- XmlAnyElementAttribute.cs