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
- DataSetFieldSchema.cs
- TextSegment.cs
- ConfigsHelper.cs
- StreamInfo.cs
- RefType.cs
- DesignerLinkAdapter.cs
- BindingExpression.cs
- DataSourceGeneratorException.cs
- Pair.cs
- ChannelManager.cs
- RequestChannelBinder.cs
- DataControlImageButton.cs
- SrgsOneOf.cs
- Drawing.cs
- FloaterBaseParaClient.cs
- XmlQualifiedName.cs
- DataMisalignedException.cs
- XslCompiledTransform.cs
- SkipQueryOptionExpression.cs
- XmlQuerySequence.cs
- WebEncodingValidator.cs
- HashAlgorithm.cs
- ReadOnlyDictionary.cs
- OLEDB_Util.cs
- DropDownButton.cs
- WindowsPen.cs
- XmlDataDocument.cs
- PeerPresenceInfo.cs
- PrimitiveXmlSerializers.cs
- HTMLTextWriter.cs
- ListViewHitTestInfo.cs
- BufferAllocator.cs
- BaseAddressElement.cs
- ObjectDataSourceFilteringEventArgs.cs
- ListBoxItemWrapperAutomationPeer.cs
- DataGridViewTextBoxColumn.cs
- GlobalizationSection.cs
- GZipStream.cs
- Permission.cs
- Documentation.cs
- BindingManagerDataErrorEventArgs.cs
- CountAggregationOperator.cs
- Paragraph.cs
- KeyEvent.cs
- TabControl.cs
- LambdaValue.cs
- IsolatedStorageSecurityState.cs
- ListBindingHelper.cs
- Propagator.ExtentPlaceholderCreator.cs
- PerformanceCountersElement.cs
- Vector3DConverter.cs
- Menu.cs
- ToolBar.cs
- DataBinder.cs
- HttpRequestBase.cs
- PartialArray.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- MembershipAdapter.cs
- Floater.cs
- ConstraintConverter.cs
- UrlAuthFailedErrorFormatter.cs
- AdornerLayer.cs
- CommandPlan.cs
- WebRequestModuleElementCollection.cs
- DictionaryEntry.cs
- ClientScriptItem.cs
- XmlWrappingReader.cs
- Expressions.cs
- DataConnectionHelper.cs
- _RequestCacheProtocol.cs
- DataControlField.cs
- Axis.cs
- DataRelation.cs
- ComboBoxRenderer.cs
- WebPartConnection.cs
- CacheVirtualItemsEvent.cs
- EditorPartCollection.cs
- CheckBoxList.cs
- NamespaceDecl.cs
- Configuration.cs
- BoundField.cs
- MaterialGroup.cs
- XMLUtil.cs
- ListBoxItemWrapperAutomationPeer.cs
- CombinedGeometry.cs
- Renderer.cs
- LocalBuilder.cs
- ApplicationSecurityManager.cs
- ToolStripPanel.cs
- DefaultValueTypeConverter.cs
- WindowsStreamSecurityBindingElement.cs
- CallbackHandler.cs
- ResourceKey.cs
- ObjectManager.cs
- GeometryGroup.cs
- X509UI.cs
- MdiWindowListItemConverter.cs
- GatewayDefinition.cs
- cookiecollection.cs
- KeyValuePairs.cs