Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Security / Cryptography / SHA1Cng.cs / 1305376 / SHA1Cng.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== using System; using System.Diagnostics.Contracts; namespace System.Security.Cryptography { ////// Wrapper around the BCrypt implementation of the SHA-1 hashing algorithm /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class SHA1Cng : SHA1 { private BCryptHashAlgorithm m_hashAlgorithm; //// [System.Security.SecurityCritical] public SHA1Cng() { Contract.Ensures(m_hashAlgorithm != null); m_hashAlgorithm = new BCryptHashAlgorithm(CngAlgorithm.Sha1, BCryptNative.ProviderName.MicrosoftPrimitiveProvider); } //// // [System.Security.SecurityCritical] protected override void Dispose(bool disposing) { try { if (disposing) { m_hashAlgorithm.Dispose(); } } finally { base.Dispose(disposing); } } //// // [System.Security.SecurityCritical] public override void Initialize() { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.Initialize(); } //// // [System.Security.SecurityCritical] protected override void HashCore(byte[] array, int ibStart, int cbSize) { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.HashCore(array, ibStart, cbSize); } //// // [System.Security.SecurityCritical] protected override byte[] HashFinal() { Contract.Assert(m_hashAlgorithm != null); return m_hashAlgorithm.HashFinal(); } } } // 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
- SqlConnectionString.cs
- IChannel.cs
- ModulesEntry.cs
- ToolStripDropDownItem.cs
- AlternationConverter.cs
- XmlSequenceWriter.cs
- ReadWriteSpinLock.cs
- StateMachine.cs
- SerializationInfo.cs
- ConfigXmlWhitespace.cs
- RightNameExpirationInfoPair.cs
- WsdlEndpointConversionContext.cs
- CatalogPartChrome.cs
- WebPart.cs
- DeobfuscatingStream.cs
- TrackingProfileSerializer.cs
- TypeBuilder.cs
- XPathParser.cs
- CallSiteHelpers.cs
- DataGridTextBoxColumn.cs
- StreamGeometry.cs
- AppSettingsExpressionBuilder.cs
- InputProcessorProfilesLoader.cs
- FixedDocumentSequencePaginator.cs
- QuotedPrintableStream.cs
- ItemList.cs
- LoadGrammarCompletedEventArgs.cs
- Win32NamedPipes.cs
- CompositeFontInfo.cs
- AdornerLayer.cs
- OutputCacheProfileCollection.cs
- Vector3DAnimationBase.cs
- HostVisual.cs
- DependencyObjectPropertyDescriptor.cs
- InputReportEventArgs.cs
- NoPersistProperty.cs
- MouseCaptureWithinProperty.cs
- SchemaManager.cs
- StylusPlugInCollection.cs
- MemberMemberBinding.cs
- IBuiltInEvidence.cs
- ArrayExtension.cs
- AvTraceFormat.cs
- WindowsEditBox.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- EventListenerClientSide.cs
- CompilerHelpers.cs
- UpdateCommandGenerator.cs
- contentDescriptor.cs
- MessageSecurityProtocolFactory.cs
- CommentAction.cs
- MatchAttribute.cs
- XmlEntity.cs
- SingleObjectCollection.cs
- Site.cs
- FormView.cs
- DependencyObjectType.cs
- DependencyPropertyChangedEventArgs.cs
- counter.cs
- FormsAuthenticationModule.cs
- XPathEmptyIterator.cs
- Activator.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- SortKey.cs
- HttpDebugHandler.cs
- RangeValuePatternIdentifiers.cs
- ConditionCollection.cs
- TextCompositionManager.cs
- OutputCacheModule.cs
- ConvertBinder.cs
- ConvertTextFrag.cs
- ArraySegment.cs
- MasterPageCodeDomTreeGenerator.cs
- Debug.cs
- NonceToken.cs
- SortedDictionary.cs
- OutOfProcStateClientManager.cs
- BuildProviderAppliesToAttribute.cs
- ChtmlTextBoxAdapter.cs
- Set.cs
- TableStyle.cs
- LinkLabelLinkClickedEvent.cs
- DispatcherEventArgs.cs
- XdrBuilder.cs
- IsolatedStorageException.cs
- HttpProcessUtility.cs
- SerialReceived.cs
- MetadataCache.cs
- CodeAttributeDeclarationCollection.cs
- _OverlappedAsyncResult.cs
- ElementHostPropertyMap.cs
- BaseTemplateParser.cs
- DeviceContext2.cs
- MouseCaptureWithinProperty.cs
- ObjectViewFactory.cs
- SymbolTable.cs
- DataComponentNameHandler.cs
- SortedSetDebugView.cs
- DataProtection.cs
- LinqDataSourceView.cs