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
- LayoutSettings.cs
- UserControlParser.cs
- SqlDataSourceSelectingEventArgs.cs
- HttpBrowserCapabilitiesWrapper.cs
- MaskInputRejectedEventArgs.cs
- SmtpNetworkElement.cs
- MarkupExtensionParser.cs
- UnmanagedBitmapWrapper.cs
- ParseChildrenAsPropertiesAttribute.cs
- ThreadExceptionEvent.cs
- MDIClient.cs
- TreeViewHitTestInfo.cs
- Int32CAMarshaler.cs
- InvalidPipelineStoreException.cs
- AuthenticationException.cs
- InitializingNewItemEventArgs.cs
- PagerStyle.cs
- EventListenerClientSide.cs
- UInt32Converter.cs
- SqlWorkflowInstanceStoreLock.cs
- ListViewDeleteEventArgs.cs
- MappingItemCollection.cs
- SecurityTokenSerializer.cs
- StrokeFIndices.cs
- CellConstant.cs
- PreviewPageInfo.cs
- CryptoApi.cs
- AdPostCacheSubstitution.cs
- ImportFileRequest.cs
- PreservationFileReader.cs
- SqlRecordBuffer.cs
- OciHandle.cs
- EditorPartCollection.cs
- __Error.cs
- CellConstant.cs
- Int16Converter.cs
- ActivationArguments.cs
- TextParaClient.cs
- MsdtcWrapper.cs
- WebPartVerbsEventArgs.cs
- ForceCopyBuildProvider.cs
- DrawTreeNodeEventArgs.cs
- BitmapPalettes.cs
- MimeTypeMapper.cs
- ListControl.cs
- DurableMessageDispatchInspector.cs
- InvalidWMPVersionException.cs
- ExtensionQuery.cs
- SQLString.cs
- XsltSettings.cs
- ModifyActivitiesPropertyDescriptor.cs
- TypeGeneratedEventArgs.cs
- GeneralTransform2DTo3D.cs
- PropertyDescriptorComparer.cs
- TargetInvocationException.cs
- FunctionCommandText.cs
- DesignerDataTable.cs
- InstancePersistence.cs
- OneToOneMappingSerializer.cs
- DataGridAddNewRow.cs
- WindowsToolbar.cs
- TypeConverterMarkupExtension.cs
- BooleanAnimationUsingKeyFrames.cs
- _BaseOverlappedAsyncResult.cs
- TextPatternIdentifiers.cs
- EndEvent.cs
- PropertyKey.cs
- PopupRootAutomationPeer.cs
- ListBox.cs
- ContextQuery.cs
- DocumentScope.cs
- ConfigurationStrings.cs
- Renderer.cs
- TaskFormBase.cs
- AssertUtility.cs
- UIElementCollection.cs
- AnnotationHelper.cs
- ContentType.cs
- SeekStoryboard.cs
- AlphaSortedEnumConverter.cs
- ExtendedPropertyDescriptor.cs
- AnnotationObservableCollection.cs
- AuthenticationConfig.cs
- EndpointIdentity.cs
- SSmlParser.cs
- XmlNamespaceManager.cs
- PageContentCollection.cs
- _BufferOffsetSize.cs
- SelectionChangedEventArgs.cs
- TcpClientSocketManager.cs
- GeometryGroup.cs
- LineServicesCallbacks.cs
- Exceptions.cs
- ToolStripProgressBar.cs
- SingleObjectCollection.cs
- XmlIterators.cs
- DataGridViewTextBoxColumn.cs
- SQLDouble.cs
- EditorZone.cs
- XmlBoundElement.cs