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
- BridgeDataRecord.cs
- BuildResult.cs
- SafeMILHandleMemoryPressure.cs
- SetterBaseCollection.cs
- ParenthesizePropertyNameAttribute.cs
- Base64Encoder.cs
- DateTime.cs
- FixedSOMPage.cs
- SizeAnimationBase.cs
- UrlMapping.cs
- ToolStripSplitButton.cs
- CardSpaceShim.cs
- MetadataWorkspace.cs
- DataGridColumn.cs
- SspiWrapper.cs
- SeparatorAutomationPeer.cs
- ParseElementCollection.cs
- FilterEventArgs.cs
- PersonalizableAttribute.cs
- TypeElement.cs
- sqlinternaltransaction.cs
- HelpKeywordAttribute.cs
- EdmComplexPropertyAttribute.cs
- CodeSubDirectory.cs
- InputReportEventArgs.cs
- xamlnodes.cs
- ChangeNode.cs
- PagesSection.cs
- FacetEnabledSchemaElement.cs
- QueryOutputWriter.cs
- LeafCellTreeNode.cs
- Helpers.cs
- BaseDataBoundControlDesigner.cs
- BinaryNode.cs
- HttpGetProtocolImporter.cs
- HttpCacheVary.cs
- WebPartTransformerCollection.cs
- OleServicesContext.cs
- RightNameExpirationInfoPair.cs
- StringValueConverter.cs
- CodeValidator.cs
- PageContentAsyncResult.cs
- PanelDesigner.cs
- CmsUtils.cs
- ValidationSummary.cs
- DrawingCollection.cs
- WebPartCancelEventArgs.cs
- LinqDataSourceView.cs
- DependencyPropertyValueSerializer.cs
- CryptoConfig.cs
- ZipIORawDataFileBlock.cs
- InitializationEventAttribute.cs
- unsafeIndexingFilterStream.cs
- IsolatedStorageException.cs
- XmlIgnoreAttribute.cs
- NavigationProperty.cs
- XmlSchemaCompilationSettings.cs
- HTTP_SERVICE_CONFIG_URLACL_PARAM.cs
- FilteredSchemaElementLookUpTable.cs
- StringReader.cs
- XmlReflectionImporter.cs
- DNS.cs
- DataGridViewCellParsingEventArgs.cs
- Application.cs
- CompositeFontInfo.cs
- WebPartsSection.cs
- XmlSchemaAppInfo.cs
- processwaithandle.cs
- AtlasWeb.Designer.cs
- ToolBarPanel.cs
- HeaderedContentControl.cs
- InputScope.cs
- RelAssertionDirectKeyIdentifierClause.cs
- WebEncodingValidatorAttribute.cs
- WinInet.cs
- MobileFormsAuthentication.cs
- WebExceptionStatus.cs
- CodeEntryPointMethod.cs
- Size.cs
- ButtonRenderer.cs
- PathFigure.cs
- DocumentCollection.cs
- MouseActionConverter.cs
- ToolStripDropDown.cs
- WebPartCloseVerb.cs
- DbModificationClause.cs
- Geometry.cs
- ToolStripContainer.cs
- OleDbStruct.cs
- TreeViewDesigner.cs
- TextServicesContext.cs
- ApplicationSettingsBase.cs
- BitmapPalette.cs
- SpellerHighlightLayer.cs
- EventItfInfo.cs
- Compress.cs
- SerializationInfo.cs
- FixedSOMElement.cs
- Duration.cs
- SystemTcpStatistics.cs