Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Security / Cryptography / SHA384CryptoServiceProvider.cs / 1305376 / SHA384CryptoServiceProvider.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-384 hashing algorithm /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class SHA384CryptoServiceProvider : SHA384 { private CapiHashAlgorithm m_hashAlgorithm; //// [System.Security.SecurityCritical] public SHA384CryptoServiceProvider() { Contract.Ensures(m_hashAlgorithm != null); m_hashAlgorithm = new CapiHashAlgorithm(CapiNative.ProviderNames.MicrosoftEnhancedRsaAes, CapiNative.ProviderType.RsaAes, CapiNative.AlgorithmId.Sha384); } //// // [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-384 hashing algorithm /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class SHA384CryptoServiceProvider : SHA384 { private CapiHashAlgorithm m_hashAlgorithm; //// [System.Security.SecurityCritical] public SHA384CryptoServiceProvider() { Contract.Ensures(m_hashAlgorithm != null); m_hashAlgorithm = new CapiHashAlgorithm(CapiNative.ProviderNames.MicrosoftEnhancedRsaAes, CapiNative.ProviderType.RsaAes, CapiNative.AlgorithmId.Sha384); } //// // [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
- ZoneIdentityPermission.cs
- SuspendDesigner.cs
- ShapingWorkspace.cs
- XmlSchemaImport.cs
- QueuePropertyVariants.cs
- StrokeNode.cs
- TableProvider.cs
- ConditionalAttribute.cs
- SiteMapNode.cs
- srgsitem.cs
- MimeTypeMapper.cs
- TextReader.cs
- TextBox.cs
- MissingFieldException.cs
- AccessorTable.cs
- SqlMethods.cs
- MethodBody.cs
- ComponentGuaranteesAttribute.cs
- SchemaContext.cs
- QueryAccessibilityHelpEvent.cs
- IteratorFilter.cs
- DefaultSection.cs
- FileIOPermission.cs
- SettingsContext.cs
- TypeToStringValueConverter.cs
- Stack.cs
- OdbcConnectionPoolProviderInfo.cs
- CriticalFinalizerObject.cs
- PreProcessInputEventArgs.cs
- PersonalizationState.cs
- GridLengthConverter.cs
- latinshape.cs
- CompilationUnit.cs
- Rect3D.cs
- XmlSchemaType.cs
- ValidationPropertyAttribute.cs
- TransportBindingElementImporter.cs
- PageThemeBuildProvider.cs
- ReliabilityContractAttribute.cs
- ConfigurationLocation.cs
- XhtmlBasicListAdapter.cs
- X509CertificateCollection.cs
- PresentationTraceSources.cs
- CacheMemory.cs
- WeakHashtable.cs
- InputLangChangeEvent.cs
- MobileControlPersister.cs
- EmptyEnumerator.cs
- ReversePositionQuery.cs
- WizardSideBarListControlItemEventArgs.cs
- ReverseInheritProperty.cs
- PassportAuthenticationModule.cs
- ErrorRuntimeConfig.cs
- DynamicValidator.cs
- DetailsViewUpdateEventArgs.cs
- HttpCacheVaryByContentEncodings.cs
- InputLanguageManager.cs
- EventLogger.cs
- FirstMatchCodeGroup.cs
- HtmlInputControl.cs
- IndexerNameAttribute.cs
- PerfProviderCollection.cs
- TextTreeUndo.cs
- SecurityTokenTypes.cs
- MemoryMappedFileSecurity.cs
- WriteTimeStream.cs
- SqlFormatter.cs
- RightsManagementPermission.cs
- BitmapEffectrendercontext.cs
- ConfigXmlSignificantWhitespace.cs
- graph.cs
- DefaultTypeArgumentAttribute.cs
- CollectionViewGroupRoot.cs
- XamlWriter.cs
- Property.cs
- TextLineResult.cs
- XamlClipboardData.cs
- configsystem.cs
- LogicalTreeHelper.cs
- Rotation3D.cs
- CngAlgorithmGroup.cs
- TemplateBamlTreeBuilder.cs
- GridViewUpdatedEventArgs.cs
- ConnectionAcceptor.cs
- SingleResultAttribute.cs
- DbModificationClause.cs
- dtdvalidator.cs
- ColumnMapProcessor.cs
- Add.cs
- CompareValidator.cs
- EdmType.cs
- Authorization.cs
- ListControl.cs
- XmlSecureResolver.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- RuntimeArgument.cs
- TopClause.cs
- CheckBoxRenderer.cs
- FixedHighlight.cs
- RegisteredArrayDeclaration.cs