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
- SessionStateUtil.cs
- OutputScopeManager.cs
- DiscoveryClientDocuments.cs
- PipeStream.cs
- DbParameterHelper.cs
- ParsedRoute.cs
- EventSetterHandlerConverter.cs
- DiscardableAttribute.cs
- Monitor.cs
- compensatingcollection.cs
- VariantWrapper.cs
- Model3DGroup.cs
- BaseTemplateParser.cs
- NavigateEvent.cs
- ClonableStack.cs
- CompleteWizardStep.cs
- InstanceData.cs
- AnimationLayer.cs
- RuntimeCompatibilityAttribute.cs
- MemberDomainMap.cs
- RelatedPropertyManager.cs
- WebServiceBindingAttribute.cs
- XmlSigningNodeWriter.cs
- SessionEndedEventArgs.cs
- TabControlEvent.cs
- ThreadStateException.cs
- DrawingContext.cs
- PreviewPrintController.cs
- SchemaHelper.cs
- StylusTouchDevice.cs
- WebPartPersonalization.cs
- GeometryGroup.cs
- TypeSemantics.cs
- MatrixValueSerializer.cs
- QilUnary.cs
- TriState.cs
- QilCloneVisitor.cs
- TargetPerspective.cs
- GuidConverter.cs
- ValidationHelpers.cs
- XmlSchemaAttributeGroup.cs
- WebControlAdapter.cs
- TextDecorationLocationValidation.cs
- XmlSchemaObjectTable.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- EnlistmentTraceIdentifier.cs
- HtmlValidatorAdapter.cs
- HtmlElementCollection.cs
- OneOfTypeConst.cs
- GZipDecoder.cs
- GenericAuthenticationEventArgs.cs
- Size3D.cs
- IntSecurity.cs
- RC2.cs
- EntityDataSourceChangingEventArgs.cs
- ValidationSummary.cs
- StorageEntityTypeMapping.cs
- AxHostDesigner.cs
- FastEncoder.cs
- IntAverageAggregationOperator.cs
- WinCategoryAttribute.cs
- DataGridCaption.cs
- Win32PrintDialog.cs
- SizeValueSerializer.cs
- Timeline.cs
- SchemaNotation.cs
- SQLStringStorage.cs
- XmlReaderSettings.cs
- cookie.cs
- ExceptionValidationRule.cs
- ComPersistableTypeElement.cs
- FreezableDefaultValueFactory.cs
- TimeZone.cs
- DeferredReference.cs
- TextContainerChangedEventArgs.cs
- CodeAccessSecurityEngine.cs
- FontNamesConverter.cs
- NameTable.cs
- Path.cs
- WorkItem.cs
- DbMetaDataCollectionNames.cs
- ExceptionHandlers.cs
- XmlSchemaGroup.cs
- ConfigXmlText.cs
- SafeProcessHandle.cs
- BufferedReadStream.cs
- FtpCachePolicyElement.cs
- EntityDataSourceUtil.cs
- Debug.cs
- DbProviderSpecificTypePropertyAttribute.cs
- GridSplitterAutomationPeer.cs
- PackageStore.cs
- DataContext.cs
- ThemeableAttribute.cs
- CodeAssignStatement.cs
- DataContractAttribute.cs
- FillRuleValidation.cs
- ValidationEventArgs.cs
- ErrorProvider.cs
- AppDomainFactory.cs