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
- sapiproxy.cs
- HitTestDrawingContextWalker.cs
- GenericEnumConverter.cs
- NullableConverter.cs
- KernelTypeValidation.cs
- SQLBinary.cs
- XmlSchemaSimpleTypeUnion.cs
- OdbcConnectionOpen.cs
- NumericExpr.cs
- XmlDomTextWriter.cs
- ColumnMapTranslator.cs
- ResourceCategoryAttribute.cs
- ToolstripProfessionalRenderer.cs
- IxmlLineInfo.cs
- BuildManagerHost.cs
- MediaContextNotificationWindow.cs
- UnionCodeGroup.cs
- HttpCookiesSection.cs
- Geometry.cs
- DirectoryNotFoundException.cs
- IProvider.cs
- XmlDigitalSignatureProcessor.cs
- WebCategoryAttribute.cs
- util.cs
- DescendentsWalker.cs
- TableHeaderCell.cs
- DBDataPermissionAttribute.cs
- Errors.cs
- InkCanvasAutomationPeer.cs
- CompilerTypeWithParams.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- StringPropertyBuilder.cs
- SelectedCellsCollection.cs
- Emitter.cs
- Point.cs
- ScrollItemPattern.cs
- MetadataSerializer.cs
- Timer.cs
- FormClosingEvent.cs
- IDispatchConstantAttribute.cs
- Triplet.cs
- IpcClientManager.cs
- SqlCacheDependencySection.cs
- ClientApiGenerator.cs
- CodeDefaultValueExpression.cs
- TextCompositionManager.cs
- ComboBoxDesigner.cs
- SystemResourceKey.cs
- WebPartTransformer.cs
- BoundField.cs
- BrowserCapabilitiesCodeGenerator.cs
- NativeActivityAbortContext.cs
- ELinqQueryState.cs
- counter.cs
- SizeAnimationUsingKeyFrames.cs
- TreeNodeBindingCollection.cs
- Operators.cs
- HttpInputStream.cs
- WindowsUserNameCachingSecurityTokenAuthenticator.cs
- PingReply.cs
- EventDescriptor.cs
- OfTypeExpression.cs
- SimpleRecyclingCache.cs
- DataBoundControl.cs
- OleDbDataAdapter.cs
- CodeSnippetExpression.cs
- XmlSchemaGroupRef.cs
- BindingEditor.xaml.cs
- VariantWrapper.cs
- ArrayConverter.cs
- TranslateTransform.cs
- WsdlInspector.cs
- XmlSchemaAnnotation.cs
- WebBaseEventKeyComparer.cs
- StackOverflowException.cs
- GridViewSortEventArgs.cs
- MatchAttribute.cs
- Message.cs
- RuleAttributes.cs
- AutoGeneratedField.cs
- ItemsPresenter.cs
- RemoteWebConfigurationHostServer.cs
- DependencyPropertyChangedEventArgs.cs
- ActivationProxy.cs
- SecurityChannelListener.cs
- AppDomainAttributes.cs
- BufferModeSettings.cs
- ServiceModelConfigurationSectionGroup.cs
- XmlNamespaceManager.cs
- WebPartRestoreVerb.cs
- SynchronizedDispatch.cs
- SerializerDescriptor.cs
- DesignerWithHeader.cs
- SoapIncludeAttribute.cs
- ObjectDisposedException.cs
- x509utils.cs
- MDIControlStrip.cs
- SByteStorage.cs
- XXXInfos.cs
- FunctionMappingTranslator.cs