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
- SspiHelper.cs
- EastAsianLunisolarCalendar.cs
- PrtTicket_Public.cs
- ListItemParagraph.cs
- ColorIndependentAnimationStorage.cs
- EndOfStreamException.cs
- FamilyMap.cs
- FontDriver.cs
- EditorPartChrome.cs
- MsmqIntegrationBindingElement.cs
- AsyncSerializedWorker.cs
- AssertUtility.cs
- ValidatorCompatibilityHelper.cs
- _AutoWebProxyScriptEngine.cs
- XsltSettings.cs
- AnimationClockResource.cs
- EditBehavior.cs
- IPEndPointCollection.cs
- CheckoutException.cs
- PrintDocument.cs
- CategoryAttribute.cs
- BamlBinaryReader.cs
- KeyBinding.cs
- HashCodeCombiner.cs
- SmtpFailedRecipientsException.cs
- StylusPointProperty.cs
- DecimalFormatter.cs
- EntityDataReader.cs
- DataControlFieldCell.cs
- ProfilePropertyMetadata.cs
- Journal.cs
- DataObject.cs
- SelectionHighlightInfo.cs
- EntityDataSourceSelectedEventArgs.cs
- AsymmetricSignatureFormatter.cs
- TypeUtil.cs
- Point3DValueSerializer.cs
- DataControlImageButton.cs
- WebContext.cs
- __ComObject.cs
- D3DImage.cs
- IgnoreDeviceFilterElement.cs
- DelegatedStream.cs
- CacheAxisQuery.cs
- FirstMatchCodeGroup.cs
- SafeViewOfFileHandle.cs
- httpapplicationstate.cs
- RightsController.cs
- PrintPreviewDialog.cs
- XmlElementAttributes.cs
- SynchronizationLockException.cs
- ScrollChrome.cs
- DoubleAnimationUsingPath.cs
- EllipseGeometry.cs
- TextElementEditingBehaviorAttribute.cs
- InvocationExpression.cs
- DataRowChangeEvent.cs
- ConnectionInterfaceCollection.cs
- DependencyPropertyValueSerializer.cs
- CategoriesDocumentFormatter.cs
- PropertyInformationCollection.cs
- BuildProvider.cs
- MatrixUtil.cs
- Thumb.cs
- Dispatcher.cs
- SafeNativeMethods.cs
- BaseValidatorDesigner.cs
- GroupAggregateExpr.cs
- ListenerAdapter.cs
- ControlFilterExpression.cs
- MethodRental.cs
- PenContext.cs
- TableAutomationPeer.cs
- CustomPopupPlacement.cs
- DomainUpDown.cs
- DesignerAdRotatorAdapter.cs
- SchemaImporter.cs
- Figure.cs
- Lazy.cs
- NameValueCache.cs
- BuildManagerHost.cs
- PointLight.cs
- TemplateEditingFrame.cs
- SettingsPropertyCollection.cs
- XmlCountingReader.cs
- ServiceDescriptionSerializer.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- BoundPropertyEntry.cs
- GetChildSubtree.cs
- AttributeQuery.cs
- BasicHttpSecurity.cs
- QuotedPrintableStream.cs
- FrameSecurityDescriptor.cs
- MachineKeyValidationConverter.cs
- MembershipSection.cs
- WebBrowserHelper.cs
- CodePrimitiveExpression.cs
- Clipboard.cs
- EventLogInformation.cs
- GrabHandleGlyph.cs