Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Security / Cryptography / SHA512CryptoServiceProvider.cs / 1305376 / SHA512CryptoServiceProvider.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-512 hashing algorithm /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class SHA512CryptoServiceProvider : SHA512 { private CapiHashAlgorithm m_hashAlgorithm; //// [System.Security.SecurityCritical] public SHA512CryptoServiceProvider() { Contract.Ensures(m_hashAlgorithm != null); m_hashAlgorithm = new CapiHashAlgorithm(CapiNative.ProviderNames.MicrosoftEnhancedRsaAes, CapiNative.ProviderType.RsaAes, CapiNative.AlgorithmId.Sha512); } //// // [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. // ==++== // // 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-512 hashing algorithm /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class SHA512CryptoServiceProvider : SHA512 { private CapiHashAlgorithm m_hashAlgorithm; //// [System.Security.SecurityCritical] public SHA512CryptoServiceProvider() { Contract.Ensures(m_hashAlgorithm != null); m_hashAlgorithm = new CapiHashAlgorithm(CapiNative.ProviderNames.MicrosoftEnhancedRsaAes, CapiNative.ProviderType.RsaAes, CapiNative.AlgorithmId.Sha512); } //// // [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
- ZipIORawDataFileBlock.cs
- BamlMapTable.cs
- SoapIncludeAttribute.cs
- FilterException.cs
- CodeValidator.cs
- RuntimeResourceSet.cs
- WebPartConnectionsCancelEventArgs.cs
- StringSorter.cs
- Int32Storage.cs
- KeyPressEvent.cs
- COM2PropertyBuilderUITypeEditor.cs
- HtmlProps.cs
- TraceSwitch.cs
- XhtmlBasicControlAdapter.cs
- DrawListViewSubItemEventArgs.cs
- DllNotFoundException.cs
- newinstructionaction.cs
- Visual3DCollection.cs
- EllipseGeometry.cs
- DataPointer.cs
- HotSpot.cs
- PropertyDescriptorCollection.cs
- DataKey.cs
- ByteFacetDescriptionElement.cs
- ApplicationTrust.cs
- PropertyPathConverter.cs
- X509SecurityTokenProvider.cs
- RepeaterItemCollection.cs
- processwaithandle.cs
- TextBox.cs
- ConfigurationManagerInternalFactory.cs
- AssertFilter.cs
- TextSimpleMarkerProperties.cs
- BitmapFrameDecode.cs
- XhtmlBasicValidatorAdapter.cs
- AccessDataSource.cs
- XmlSchemaDatatype.cs
- WS2007HttpBindingCollectionElement.cs
- PrintingPermissionAttribute.cs
- SchemaObjectWriter.cs
- GenericPrincipal.cs
- ServerIdentity.cs
- ContainerSelectorGlyph.cs
- PrivilegeNotHeldException.cs
- SyndicationFeed.cs
- DataGridPagerStyle.cs
- WebSysDisplayNameAttribute.cs
- SearchForVirtualItemEventArgs.cs
- MimeImporter.cs
- XmlNamespaceMapping.cs
- BidOverLoads.cs
- BrushConverter.cs
- DataGridViewRowEventArgs.cs
- CompilerWrapper.cs
- Encoder.cs
- TimeZone.cs
- WindowsEditBox.cs
- Interlocked.cs
- SafeFindHandle.cs
- DbMetaDataColumnNames.cs
- MexNamedPipeBindingElement.cs
- CompiledRegexRunnerFactory.cs
- AttributeQuery.cs
- SqlDataSourceConfigureSortForm.cs
- WebPartManagerInternals.cs
- StaticSiteMapProvider.cs
- versioninfo.cs
- NoneExcludedImageIndexConverter.cs
- Wildcard.cs
- ObjectViewEntityCollectionData.cs
- SmiConnection.cs
- HttpPostServerProtocol.cs
- SettingsBase.cs
- PlanCompilerUtil.cs
- Rules.cs
- HttpCacheVaryByContentEncodings.cs
- Matrix.cs
- TableLayoutStyle.cs
- MethodExpr.cs
- SecurityRequiresReviewAttribute.cs
- Trigger.cs
- HttpSocketManager.cs
- MethodExpression.cs
- StreamMarshaler.cs
- MultiViewDesigner.cs
- TextRangeEdit.cs
- _TransmitFileOverlappedAsyncResult.cs
- SiteMapSection.cs
- DrawingContextDrawingContextWalker.cs
- PathGeometry.cs
- XmlSchemaSimpleContentRestriction.cs
- TreeView.cs
- WebFormsRootDesigner.cs
- WindowInteropHelper.cs
- UserControlDocumentDesigner.cs
- XmlComment.cs
- ControlIdConverter.cs
- DataGridRowDetailsEventArgs.cs
- ArgumentException.cs
- XmlUtilWriter.cs