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
- EmbeddedMailObject.cs
- VectorCollectionValueSerializer.cs
- AmbientEnvironment.cs
- Double.cs
- GuidTagList.cs
- WebServiceMethodData.cs
- rsa.cs
- EventSinkActivityDesigner.cs
- TextElementEnumerator.cs
- FormsAuthenticationUser.cs
- DBPropSet.cs
- RegexReplacement.cs
- IconConverter.cs
- FrameworkElementFactoryMarkupObject.cs
- Int16AnimationBase.cs
- EmbeddedMailObject.cs
- ProviderSettings.cs
- ChildDocumentBlock.cs
- ReferenceSchema.cs
- IsolatedStorageFileStream.cs
- Processor.cs
- ScaleTransform.cs
- MimeWriter.cs
- ListViewGroupCollectionEditor.cs
- log.cs
- SupportsEventValidationAttribute.cs
- WindowsButton.cs
- MdiWindowListItemConverter.cs
- NativeBuffer.cs
- WebPartDisplayModeEventArgs.cs
- FontFamilyValueSerializer.cs
- TimelineGroup.cs
- SqlDependencyListener.cs
- XmlSchemaSimpleTypeRestriction.cs
- ImportCatalogPart.cs
- BufferBuilder.cs
- CheckableControlBaseAdapter.cs
- ExceptionDetail.cs
- OdbcParameter.cs
- Point3DConverter.cs
- glyphs.cs
- UserPreferenceChangedEventArgs.cs
- SqlGenericUtil.cs
- DefaultIfEmptyQueryOperator.cs
- XmlMtomReader.cs
- CharacterMetricsDictionary.cs
- Constants.cs
- HtmlValidationSummaryAdapter.cs
- CodeSnippetStatement.cs
- RadioButtonStandardAdapter.cs
- ImageBrush.cs
- AxisAngleRotation3D.cs
- BitmapCodecInfoInternal.cs
- VirtualizingStackPanel.cs
- SQLInt16.cs
- DetailsViewCommandEventArgs.cs
- DBCSCodePageEncoding.cs
- CellCreator.cs
- SSmlParser.cs
- LayeredChannelFactory.cs
- DataServiceRequestOfT.cs
- RelationshipConverter.cs
- OperationAbortedException.cs
- Control.cs
- FormViewPagerRow.cs
- XmlIgnoreAttribute.cs
- RemoteTokenFactory.cs
- xsdvalidator.cs
- XmlWellformedWriter.cs
- XmlSequenceWriter.cs
- DocComment.cs
- Interop.cs
- CustomWebEventKey.cs
- TemplateField.cs
- OdbcInfoMessageEvent.cs
- AnnotationAdorner.cs
- InsufficientMemoryException.cs
- CodeCompileUnit.cs
- TdsEnums.cs
- WSSecureConversation.cs
- ConstrainedGroup.cs
- ISCIIEncoding.cs
- TileBrush.cs
- MethodBuilder.cs
- Win32Native.cs
- ChannelManager.cs
- SqlDataSourceCache.cs
- CardSpaceException.cs
- BinHexDecoder.cs
- DescriptionCreator.cs
- DirectionalLight.cs
- Validator.cs
- Timer.cs
- SHA512Managed.cs
- GestureRecognitionResult.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- InputScopeManager.cs
- TextInfo.cs
- VariableQuery.cs
- ObjectContext.cs