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
- InvalidDataContractException.cs
- DbCommandTree.cs
- ThemeableAttribute.cs
- PrimitiveType.cs
- InkCanvasAutomationPeer.cs
- TextEvent.cs
- FieldAccessException.cs
- ImmutableAssemblyCacheEntry.cs
- WebControl.cs
- TraceSection.cs
- MetabaseServerConfig.cs
- LinearKeyFrames.cs
- sqlpipe.cs
- Figure.cs
- MissingManifestResourceException.cs
- XmlAttributeCollection.cs
- HttpValueCollection.cs
- VersionConverter.cs
- DecoratedNameAttribute.cs
- EventListener.cs
- hwndwrapper.cs
- ConnectionPoint.cs
- XMLDiffLoader.cs
- XmlSerializationReader.cs
- NonParentingControl.cs
- CompilerInfo.cs
- ResourcePool.cs
- NavigatingCancelEventArgs.cs
- ColumnResizeUndoUnit.cs
- InstanceData.cs
- QilTargetType.cs
- RequestSecurityToken.cs
- InOutArgumentConverter.cs
- SqlCommand.cs
- PassportAuthenticationModule.cs
- Context.cs
- FieldAccessException.cs
- ReaderWriterLockSlim.cs
- Parser.cs
- RegexRunner.cs
- SemaphoreFullException.cs
- StringFreezingAttribute.cs
- WebPartZoneBaseDesigner.cs
- MessagePropertyAttribute.cs
- PersonalizationProviderCollection.cs
- DesignerCategoryAttribute.cs
- TextServicesHost.cs
- DataGridViewHeaderCell.cs
- MsmqElementBase.cs
- LateBoundChannelParameterCollection.cs
- DataGridViewSortCompareEventArgs.cs
- EventData.cs
- CompilerErrorCollection.cs
- FileDataSourceCache.cs
- ProviderConnectionPoint.cs
- RegistryConfigurationProvider.cs
- NativeMethods.cs
- Timeline.cs
- Missing.cs
- GeneralTransform3D.cs
- CompositeActivityTypeDescriptorProvider.cs
- SamlDelegatingWriter.cs
- XmlSchemaProviderAttribute.cs
- DataKeyArray.cs
- HashAlgorithm.cs
- XmlElementList.cs
- FocusManager.cs
- Listbox.cs
- _NtlmClient.cs
- RoutedEventHandlerInfo.cs
- WebRequestModuleElementCollection.cs
- HTTPRemotingHandler.cs
- BitmapEffectInputData.cs
- CategoryAttribute.cs
- LinkedResourceCollection.cs
- Page.cs
- DurableInstancingOptions.cs
- DaylightTime.cs
- MenuEventArgs.cs
- CancellationScope.cs
- EncodingInfo.cs
- X509CertificateRecipientClientCredential.cs
- TextEndOfSegment.cs
- WriteableBitmap.cs
- CompilerErrorCollection.cs
- X509DefaultServiceCertificateElement.cs
- DrawListViewSubItemEventArgs.cs
- RemotingAttributes.cs
- ValidationSummary.cs
- AutoSizeToolBoxItem.cs
- XPathParser.cs
- ConnectorRouter.cs
- ExpressionBuilderCollection.cs
- XPathNavigator.cs
- ConstraintManager.cs
- exports.cs
- Automation.cs
- TagNameToTypeMapper.cs
- sqlstateclientmanager.cs
- DataGridViewCellStyleConverter.cs