Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Security / Cryptography / SHA384Cng.cs / 1305376 / SHA384Cng.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== using System; using System.Diagnostics.Contracts; namespace System.Security.Cryptography { ////// Wrapper around the BCrypt implementation of the SHA-384 hashing algorithm /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class SHA384Cng : SHA384 { private BCryptHashAlgorithm m_hashAlgorithm; //// [System.Security.SecurityCritical] public SHA384Cng() { Contract.Ensures(m_hashAlgorithm != null); m_hashAlgorithm = new BCryptHashAlgorithm(CngAlgorithm.Sha384, BCryptNative.ProviderName.MicrosoftPrimitiveProvider); } //// // [System.Security.SecurityCritical] protected override void Dispose(bool disposing) { try { if (disposing) { m_hashAlgorithm.Dispose(); } } finally { base.Dispose(disposing); } } //// // [System.Security.SecurityCritical] public override void Initialize() { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.Initialize(); } //// // [System.Security.SecurityCritical] protected override void HashCore(byte[] array, int ibStart, int cbSize) { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.HashCore(array, ibStart, cbSize); } //// // [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 BCrypt implementation of the SHA-384 hashing algorithm /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class SHA384Cng : SHA384 { private BCryptHashAlgorithm m_hashAlgorithm; //// [System.Security.SecurityCritical] public SHA384Cng() { Contract.Ensures(m_hashAlgorithm != null); m_hashAlgorithm = new BCryptHashAlgorithm(CngAlgorithm.Sha384, BCryptNative.ProviderName.MicrosoftPrimitiveProvider); } //// // [System.Security.SecurityCritical] protected override void Dispose(bool disposing) { try { if (disposing) { m_hashAlgorithm.Dispose(); } } finally { base.Dispose(disposing); } } //// // [System.Security.SecurityCritical] public override void Initialize() { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.Initialize(); } //// // [System.Security.SecurityCritical] protected override void HashCore(byte[] array, int ibStart, int cbSize) { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.HashCore(array, ibStart, cbSize); } //// // [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
- COSERVERINFO.cs
- ProxyManager.cs
- ToolStripDropDownButton.cs
- DocumentPageViewAutomationPeer.cs
- DataGridViewRowCollection.cs
- XhtmlBasicPageAdapter.cs
- SqlDataSourceCache.cs
- DocumentReference.cs
- ListItemCollection.cs
- PersonalizationProviderHelper.cs
- DataGridViewCellLinkedList.cs
- ServerProtocol.cs
- AdornerLayer.cs
- XmlCharType.cs
- Operator.cs
- StrongNamePublicKeyBlob.cs
- Function.cs
- HelpInfo.cs
- ConstNode.cs
- HashMembershipCondition.cs
- Label.cs
- DependencyPropertyKind.cs
- TextTrailingCharacterEllipsis.cs
- RectAnimationUsingKeyFrames.cs
- CultureTableRecord.cs
- TableCellCollection.cs
- TableHeaderCell.cs
- WeakRefEnumerator.cs
- BuildProvidersCompiler.cs
- PixelFormat.cs
- UIElement3D.cs
- XmlSchemaFacet.cs
- ToggleProviderWrapper.cs
- JournalEntry.cs
- CookielessHelper.cs
- DirectoryObjectSecurity.cs
- ConfigurationManagerHelperFactory.cs
- CompiledQuery.cs
- DataMisalignedException.cs
- SqlClientMetaDataCollectionNames.cs
- PocoEntityKeyStrategy.cs
- TCEAdapterGenerator.cs
- CheckBoxRenderer.cs
- ConfigurationElementCollection.cs
- GridViewRowEventArgs.cs
- MultiSelector.cs
- HeaderedItemsControl.cs
- PropertyInformation.cs
- StructuralCache.cs
- ClientTargetSection.cs
- BindingExpressionUncommonField.cs
- TextEditorThreadLocalStore.cs
- TextDecoration.cs
- ViewEventArgs.cs
- AlternateView.cs
- XamlToRtfParser.cs
- RectAnimationBase.cs
- XPathConvert.cs
- IntSecurity.cs
- KernelTypeValidation.cs
- MatrixCamera.cs
- Pkcs9Attribute.cs
- TreeNode.cs
- AutomationIdentifierGuids.cs
- ArrayItemReference.cs
- WizardStepBase.cs
- PaginationProgressEventArgs.cs
- GridViewRowCollection.cs
- Action.cs
- XmlUnspecifiedAttribute.cs
- XmlAttributeCollection.cs
- Dispatcher.cs
- IUnknownConstantAttribute.cs
- PersonalizationStateInfo.cs
- MobileSysDescriptionAttribute.cs
- SwitchLevelAttribute.cs
- CharConverter.cs
- SqlErrorCollection.cs
- ConfigXmlDocument.cs
- MatrixAnimationUsingPath.cs
- KernelTypeValidation.cs
- ConfigXmlDocument.cs
- MatrixTransform3D.cs
- WebPartRestoreVerb.cs
- VectorAnimationUsingKeyFrames.cs
- BigInt.cs
- EventListenerClientSide.cs
- XmlHelper.cs
- PolicyLevel.cs
- OneToOneMappingSerializer.cs
- StyleTypedPropertyAttribute.cs
- SettingsPropertyValue.cs
- WorkflowServiceBuildProvider.cs
- MenuStrip.cs
- ValidationHelpers.cs
- WhereaboutsReader.cs
- WebRequestModuleElement.cs
- TextFormatterContext.cs
- DataBoundControlAdapter.cs
- WebControlsSection.cs