Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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 check for failures and throw the appropriate exception 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 check for failures and throw the appropriate exception 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); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ColumnCollection.cs
- ColorConvertedBitmap.cs
- WebPart.cs
- NativeMethods.cs
- SemanticBasicElement.cs
- DataObjectSettingDataEventArgs.cs
- DeviceContexts.cs
- DrawingContext.cs
- Decoder.cs
- AnimationClock.cs
- GridViewDeletedEventArgs.cs
- StandardCommands.cs
- ListViewInsertEventArgs.cs
- counter.cs
- Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
- PrintDialog.cs
- Soap.cs
- PanningMessageFilter.cs
- CompareValidator.cs
- XmlIncludeAttribute.cs
- arc.cs
- ActivityTypeCodeDomSerializer.cs
- HtmlInputPassword.cs
- ValueQuery.cs
- COMException.cs
- SerializationObjectManager.cs
- XmlException.cs
- ColorConverter.cs
- XPathMessageContext.cs
- TextMetrics.cs
- XmlDataImplementation.cs
- EntityCommandExecutionException.cs
- SmiXetterAccessMap.cs
- BindingMAnagerBase.cs
- Stackframe.cs
- XmlBaseReader.cs
- ModelItemImpl.cs
- Point.cs
- RuntimeVariableList.cs
- BCryptSafeHandles.cs
- ExceptionHelpers.cs
- CodeCommentStatement.cs
- PocoPropertyAccessorStrategy.cs
- FileEnumerator.cs
- CodeExpressionStatement.cs
- CompilerResults.cs
- SecurityContextSecurityTokenResolver.cs
- InsufficientMemoryException.cs
- XPathArrayIterator.cs
- ExternalFile.cs
- ApplicationServiceHelper.cs
- OdbcPermission.cs
- MgmtConfigurationRecord.cs
- DataSetMappper.cs
- XmlSerializerFactory.cs
- UpdatableWrapper.cs
- ClassDataContract.cs
- IDQuery.cs
- WebScriptMetadataMessageEncoderFactory.cs
- EntityProxyTypeInfo.cs
- UnmanagedBitmapWrapper.cs
- ProfileSettingsCollection.cs
- RelationshipType.cs
- messageonlyhwndwrapper.cs
- TimeSpan.cs
- WindowsListViewItemCheckBox.cs
- HandlerBase.cs
- OLEDB_Util.cs
- CodeCompiler.cs
- Activity.cs
- MarshalByValueComponent.cs
- AutoGeneratedFieldProperties.cs
- PersistChildrenAttribute.cs
- precedingquery.cs
- PeerNameRegistration.cs
- ColorAnimationUsingKeyFrames.cs
- FilterElement.cs
- UriExt.cs
- SafeMILHandle.cs
- ReadOnlyTernaryTree.cs
- InheritedPropertyChangedEventArgs.cs
- Version.cs
- TextRunTypographyProperties.cs
- DescendantQuery.cs
- HttpModuleActionCollection.cs
- RelationshipEnd.cs
- TextContainer.cs
- EditCommandColumn.cs
- ColorMap.cs
- PointAnimationUsingKeyFrames.cs
- Workspace.cs
- BuildProviderAppliesToAttribute.cs
- ItemsControl.cs
- NumberFormatter.cs
- StylusPointDescription.cs
- SHA384.cs
- ColorMatrix.cs
- EventHandlersStore.cs
- COSERVERINFO.cs
- CodeDirectoryCompiler.cs