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
- CubicEase.cs
- RoleManagerSection.cs
- TransformerInfo.cs
- ResetableIterator.cs
- DateTimeOffset.cs
- NetworkInformationPermission.cs
- AttributeProviderAttribute.cs
- XmlDataCollection.cs
- InlinedAggregationOperator.cs
- FontNameConverter.cs
- OleDbSchemaGuid.cs
- AlternateViewCollection.cs
- ModifyActivitiesPropertyDescriptor.cs
- StyleBamlTreeBuilder.cs
- DataBindingCollectionEditor.cs
- ThicknessAnimation.cs
- SizeLimitedCache.cs
- PointHitTestResult.cs
- GlyphRun.cs
- IfJoinedCondition.cs
- ContainerVisual.cs
- HttpResponse.cs
- ObjectDataSourceWizardForm.cs
- validation.cs
- CapabilitiesAssignment.cs
- TextMessageEncoder.cs
- ShaperBuffers.cs
- PropertyToken.cs
- InteropBitmapSource.cs
- PropertyPath.cs
- Nodes.cs
- WindowsListBox.cs
- UTF32Encoding.cs
- PathFigureCollection.cs
- HebrewCalendar.cs
- LinkTarget.cs
- HttpServerVarsCollection.cs
- Dump.cs
- XamlStream.cs
- VisualStyleElement.cs
- XmlWhitespace.cs
- MimeBasePart.cs
- MouseOverProperty.cs
- SafeEventLogReadHandle.cs
- CaseInsensitiveComparer.cs
- RewritingProcessor.cs
- ReflectTypeDescriptionProvider.cs
- StorageMappingItemLoader.cs
- WebPartManagerInternals.cs
- HtmlImage.cs
- CompareValidator.cs
- DesignerSerializationOptionsAttribute.cs
- PropertyDescriptorGridEntry.cs
- EditingCommands.cs
- DataSourceSelectArguments.cs
- FlowLayout.cs
- XmlSchemaDatatype.cs
- IntSecurity.cs
- EntityConnectionStringBuilder.cs
- ADConnectionHelper.cs
- SingleObjectCollection.cs
- GroupJoinQueryOperator.cs
- UnsafeNativeMethods.cs
- ToolboxItem.cs
- DataTemplateKey.cs
- ExtractedStateEntry.cs
- CallSiteOps.cs
- Guid.cs
- CursorConverter.cs
- MobileTextWriter.cs
- MembershipValidatePasswordEventArgs.cs
- Ticks.cs
- FormatVersion.cs
- coordinatorscratchpad.cs
- ChannelSinkStacks.cs
- GatewayDefinition.cs
- PolyLineSegmentFigureLogic.cs
- RawStylusInputCustomDataList.cs
- DetailsViewInsertedEventArgs.cs
- Vector3DCollectionConverter.cs
- ApplicationTrust.cs
- UpdatePanelTriggerCollection.cs
- EventWaitHandleSecurity.cs
- SimpleLine.cs
- TableStyle.cs
- HtmlInputCheckBox.cs
- columnmapfactory.cs
- Matrix3DConverter.cs
- PeerNameResolver.cs
- SafeTokenHandle.cs
- TextureBrush.cs
- RowTypeElement.cs
- DBParameter.cs
- WebBrowsableAttribute.cs
- ResourceContainerWrapper.cs
- TypeExtensionSerializer.cs
- EventPropertyMap.cs
- assertwrapper.cs
- ApplicationException.cs
- SmtpSpecifiedPickupDirectoryElement.cs