Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Security / Cryptography / SHA256CryptoServiceProvider.cs / 1305376 / SHA256CryptoServiceProvider.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== using System; using System.Diagnostics.Contracts; namespace System.Security.Cryptography { ////// Wrapper around the CAPI implementation of the SHA-256 hashing algorithm /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class SHA256CryptoServiceProvider : SHA256 { private CapiHashAlgorithm m_hashAlgorithm; //// [System.Security.SecurityCritical] public SHA256CryptoServiceProvider() { Contract.Ensures(m_hashAlgorithm != null); m_hashAlgorithm = new CapiHashAlgorithm(CapiNative.ProviderNames.MicrosoftEnhancedRsaAes, CapiNative.ProviderType.RsaAes, CapiNative.AlgorithmId.Sha256); } //// // [System.Security.SecurityCritical] protected override void Dispose(bool disposing) { try { if (disposing) { m_hashAlgorithm.Dispose(); } } finally { base.Dispose(disposing); } } ///// /// Reset the hash algorithm to begin hashing a new set of data /// //// [System.Security.SecurityCritical] public override void Initialize() { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.Initialize(); } ///// /// Hash a block of data /// //// [System.Security.SecurityCritical] protected override void HashCore(byte[] array, int ibStart, int cbSize) { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.HashCore(array, ibStart, cbSize); } ///// /// Complete the hash, returning its value /// //// [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
- HttpDebugHandler.cs
- BooleanFunctions.cs
- EdmProperty.cs
- PeerApplication.cs
- SecurityState.cs
- ClientSettingsStore.cs
- ACL.cs
- SignedPkcs7.cs
- FileDialogCustomPlace.cs
- OpenTypeCommon.cs
- PositiveTimeSpanValidator.cs
- QueryContinueDragEventArgs.cs
- Baml2006ReaderSettings.cs
- BinaryKeyIdentifierClause.cs
- UpdateTracker.cs
- OleDbConnectionInternal.cs
- GridViewRowPresenter.cs
- DBCSCodePageEncoding.cs
- DebugView.cs
- SvcMapFileSerializer.cs
- InheritedPropertyDescriptor.cs
- Application.cs
- EmptyEnumerator.cs
- ConstructorExpr.cs
- QilPatternFactory.cs
- Int32Rect.cs
- BinaryConverter.cs
- SqlVersion.cs
- WindowsTooltip.cs
- ControlTemplate.cs
- MetadataProperty.cs
- MonitoringDescriptionAttribute.cs
- CallContext.cs
- CommandBindingCollection.cs
- NamespaceInfo.cs
- MethodInfo.cs
- activationcontext.cs
- RequestBringIntoViewEventArgs.cs
- WebMethodAttribute.cs
- SQLBinary.cs
- EntityKeyElement.cs
- SafePEFileHandle.cs
- PolyQuadraticBezierSegment.cs
- DbgUtil.cs
- Bold.cs
- WindowsNonControl.cs
- Help.cs
- ParenExpr.cs
- DefaultValueTypeConverter.cs
- NameScope.cs
- basevalidator.cs
- RepeatButtonAutomationPeer.cs
- ConsoleKeyInfo.cs
- InputProcessorProfilesLoader.cs
- HierarchicalDataBoundControl.cs
- SqlDependency.cs
- DashStyles.cs
- TypeListConverter.cs
- OutputScopeManager.cs
- TextRangeAdaptor.cs
- PatternMatchRules.cs
- BindingMAnagerBase.cs
- ValuePattern.cs
- OutOfProcStateClientManager.cs
- HttpResponseBase.cs
- DataSpaceManager.cs
- ObfuscationAttribute.cs
- IssuanceTokenProviderBase.cs
- Process.cs
- JsonDeserializer.cs
- DbTransaction.cs
- PersistenceTypeAttribute.cs
- PublisherMembershipCondition.cs
- AppSettingsExpressionBuilder.cs
- WorkflowValidationFailedException.cs
- XMLSyntaxException.cs
- WsiProfilesElementCollection.cs
- ValidationEventArgs.cs
- ByteStack.cs
- CounterCreationDataCollection.cs
- XmlnsDefinitionAttribute.cs
- Label.cs
- ProcessHostServerConfig.cs
- EventLogger.cs
- SuppressMessageAttribute.cs
- LayoutTableCell.cs
- activationcontext.cs
- StringCollection.cs
- UIElementPropertyUndoUnit.cs
- FormatVersion.cs
- IsolatedStorage.cs
- XmlQueryOutput.cs
- ParentControlDesigner.cs
- Window.cs
- UnmanagedMemoryStreamWrapper.cs
- MaskPropertyEditor.cs
- DisposableCollectionWrapper.cs
- Decorator.cs
- CompilationSection.cs
- DocumentSchemaValidator.cs