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
- ImpersonateTokenRef.cs
- BaseParser.cs
- AuthenticateEventArgs.cs
- UrlPropertyAttribute.cs
- MsmqIntegrationBindingCollectionElement.cs
- TextEncodedRawTextWriter.cs
- RequestNavigateEventArgs.cs
- CodeAssignStatement.cs
- ReflectTypeDescriptionProvider.cs
- VisualStyleInformation.cs
- DataServiceQueryException.cs
- ErrorActivity.cs
- HMACSHA256.cs
- NavigatorInput.cs
- Timer.cs
- TogglePatternIdentifiers.cs
- HtmlControlDesigner.cs
- PersistenceException.cs
- SwitchElementsCollection.cs
- XmlSchemaSubstitutionGroup.cs
- webbrowsersite.cs
- HttpServerVarsCollection.cs
- FacetValueContainer.cs
- DataException.cs
- AssemblySettingAttributes.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- BitmapScalingModeValidation.cs
- AnimatedTypeHelpers.cs
- RelationshipWrapper.cs
- ScriptRef.cs
- SubtreeProcessor.cs
- MulticastNotSupportedException.cs
- SRGSCompiler.cs
- DrawListViewItemEventArgs.cs
- XPathBuilder.cs
- InternalControlCollection.cs
- InstancePersistenceContext.cs
- ResourceExpressionBuilder.cs
- Substitution.cs
- SqlTriggerAttribute.cs
- VisualStateChangedEventArgs.cs
- CommandLibraryHelper.cs
- CharacterBufferReference.cs
- WSHttpTransportSecurityElement.cs
- ProviderUtil.cs
- NativeMethods.cs
- SpnEndpointIdentityExtension.cs
- CalendarDay.cs
- DataSet.cs
- GridViewColumnHeader.cs
- SqlTriggerAttribute.cs
- AppModelKnownContentFactory.cs
- ParameterCollection.cs
- ServiceSecurityAuditElement.cs
- ContextMenuStripGroupCollection.cs
- StylusOverProperty.cs
- DocumentApplicationJournalEntry.cs
- SizeF.cs
- GiveFeedbackEvent.cs
- NameTable.cs
- StateValidator.cs
- RootBuilder.cs
- EditingCoordinator.cs
- KnowledgeBase.cs
- __ConsoleStream.cs
- VScrollBar.cs
- PingOptions.cs
- NativeMethods.cs
- NumericUpDownAcceleration.cs
- InputManager.cs
- TextBoxBaseDesigner.cs
- XmlLoader.cs
- ExpressionBuilderContext.cs
- TypeForwardedToAttribute.cs
- TimelineClockCollection.cs
- DefaultTextStore.cs
- DataProviderNameConverter.cs
- SqlCacheDependencyDatabase.cs
- FrameworkPropertyMetadata.cs
- ExpressionConverter.cs
- SelectorItemAutomationPeer.cs
- HijriCalendar.cs
- __Filters.cs
- SafeNativeMethodsMilCoreApi.cs
- StylusEditingBehavior.cs
- FloaterBaseParaClient.cs
- ToolStripPanel.cs
- XPathNavigatorReader.cs
- ParameterCollection.cs
- GridItemCollection.cs
- TabControlCancelEvent.cs
- DataGridViewColumn.cs
- FunctionImportElement.cs
- NativeMethods.cs
- SkewTransform.cs
- CookieProtection.cs
- ADConnectionHelper.cs
- Missing.cs
- DataRelationCollection.cs
- ByteStreamGeometryContext.cs