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
- SchemaType.cs
- OracleConnectionString.cs
- WrapPanel.cs
- Vars.cs
- BitmapEffectDrawing.cs
- ByteFacetDescriptionElement.cs
- SymbolDocumentGenerator.cs
- nulltextcontainer.cs
- DoubleCollection.cs
- Exceptions.cs
- DynamicHyperLink.cs
- grammarelement.cs
- ListViewItemSelectionChangedEvent.cs
- CodeAttributeArgumentCollection.cs
- ScriptingAuthenticationServiceSection.cs
- TraceHelpers.cs
- DrawListViewSubItemEventArgs.cs
- CodeMemberField.cs
- InvalidPipelineStoreException.cs
- AppDomainAttributes.cs
- DataColumnMappingCollection.cs
- XmlSchemaComplexContent.cs
- MissingSatelliteAssemblyException.cs
- StringConcat.cs
- HttpProfileBase.cs
- HtmlInputButton.cs
- HttpApplicationStateWrapper.cs
- CompiledRegexRunner.cs
- Rule.cs
- WebPartsSection.cs
- _LocalDataStore.cs
- VScrollProperties.cs
- HealthMonitoringSection.cs
- RelationalExpressions.cs
- Figure.cs
- OpenTypeLayout.cs
- SHA256Managed.cs
- DbParameterHelper.cs
- InternalConfigEventArgs.cs
- ChineseLunisolarCalendar.cs
- TableParaClient.cs
- RestClientProxyHandler.cs
- ModuleBuilder.cs
- XmlNotation.cs
- ShimAsPublicXamlType.cs
- StringReader.cs
- XPathBinder.cs
- SafeCryptContextHandle.cs
- LinkConverter.cs
- GPStream.cs
- MissingMemberException.cs
- ListManagerBindingsCollection.cs
- XmlDataDocument.cs
- EventPropertyMap.cs
- WmlTextViewAdapter.cs
- XPathNodeIterator.cs
- BamlLocalizabilityResolver.cs
- GeneralTransform.cs
- ConstrainedDataObject.cs
- ContentHostHelper.cs
- MatrixTransform3D.cs
- _NtlmClient.cs
- WebRequestModulesSection.cs
- GridViewColumnCollection.cs
- RegistrySecurity.cs
- VirtualizingPanel.cs
- SqlExpressionNullability.cs
- EdmValidator.cs
- ResolveNameEventArgs.cs
- ProcessThread.cs
- StandardRuntimeEnumValidatorAttribute.cs
- ScopelessEnumAttribute.cs
- SqlProviderServices.cs
- CodeExporter.cs
- JulianCalendar.cs
- Emitter.cs
- exports.cs
- ProviderException.cs
- DataTableExtensions.cs
- OpCodes.cs
- Span.cs
- documentsequencetextcontainer.cs
- DataPagerField.cs
- XmlILOptimizerVisitor.cs
- PathFigureCollection.cs
- MDIClient.cs
- PageCodeDomTreeGenerator.cs
- UpdateCompiler.cs
- DecoderExceptionFallback.cs
- DownloadProgressEventArgs.cs
- ModuleConfigurationInfo.cs
- SqlServer2KCompatibilityAnnotation.cs
- FormatException.cs
- UnsafeNetInfoNativeMethods.cs
- DifferencingCollection.cs
- EmptyImpersonationContext.cs
- TextMetrics.cs
- PersonalizationProviderCollection.cs
- ViewStateModeByIdAttribute.cs
- SecurityVerifiedMessage.cs