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
- TextRangeAdaptor.cs
- RegionInfo.cs
- EncoderFallback.cs
- CodeDomDecompiler.cs
- TextModifierScope.cs
- SerializationInfo.cs
- DataServiceClientException.cs
- ContentElement.cs
- EnterpriseServicesHelper.cs
- FileDialogCustomPlacesCollection.cs
- FontClient.cs
- ProfileInfo.cs
- WebPartDeleteVerb.cs
- SimpleTypeResolver.cs
- EntityDataSourceQueryBuilder.cs
- ExternalException.cs
- NameValueFileSectionHandler.cs
- RegexWorker.cs
- StringAttributeCollection.cs
- TextTreeObjectNode.cs
- DataRecordInternal.cs
- FlagsAttribute.cs
- Expander.cs
- DomainLiteralReader.cs
- BamlRecordWriter.cs
- ReadOnlyKeyedCollection.cs
- DataGridViewColumn.cs
- unsafenativemethodsother.cs
- GenericEnumerator.cs
- HierarchicalDataSourceDesigner.cs
- SQLString.cs
- _LoggingObject.cs
- NetworkCredential.cs
- ParserStreamGeometryContext.cs
- TableColumn.cs
- XmlEncodedRawTextWriter.cs
- EntityContainerAssociationSetEnd.cs
- LineUtil.cs
- MdiWindowListItemConverter.cs
- InputManager.cs
- UnknownBitmapEncoder.cs
- PrinterSettings.cs
- CannotUnloadAppDomainException.cs
- DeviceContext.cs
- XmlBinaryWriter.cs
- SetStoryboardSpeedRatio.cs
- CodeCompileUnit.cs
- TablePatternIdentifiers.cs
- SystemKeyConverter.cs
- AuthenticationServiceManager.cs
- EndEvent.cs
- PointHitTestResult.cs
- UInt64Storage.cs
- SqlGatherConsumedAliases.cs
- WebPartConnectionsDisconnectVerb.cs
- SystemMulticastIPAddressInformation.cs
- OuterGlowBitmapEffect.cs
- DoubleConverter.cs
- Keywords.cs
- TextBox.cs
- XMLSchema.cs
- ToolStripOverflow.cs
- WebExceptionStatus.cs
- MasterPageBuildProvider.cs
- DataSourceXmlElementAttribute.cs
- AffineTransform3D.cs
- TerminatorSinks.cs
- PageSetupDialog.cs
- InvalidAsynchronousStateException.cs
- ProfileService.cs
- CellParagraph.cs
- XmlCustomFormatter.cs
- FormCollection.cs
- BindingExpressionBase.cs
- WsdlServiceChannelBuilder.cs
- SourceSwitch.cs
- EventLogEntry.cs
- Int16KeyFrameCollection.cs
- AddInAttribute.cs
- RuntimeArgumentHandle.cs
- DbFunctionCommandTree.cs
- PointLight.cs
- UserNameSecurityToken.cs
- RayHitTestParameters.cs
- WebBrowserNavigatedEventHandler.cs
- MatrixAnimationUsingKeyFrames.cs
- DataStorage.cs
- ComNativeDescriptor.cs
- IResourceProvider.cs
- Ref.cs
- Int64AnimationBase.cs
- EndOfStreamException.cs
- linebase.cs
- UpDownEvent.cs
- CreateInstanceBinder.cs
- DesignerTransactionCloseEvent.cs
- embossbitmapeffect.cs
- TcpTransportBindingElement.cs
- SettingsPropertyWrongTypeException.cs
- CompareInfo.cs