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
- XmlSchemaImport.cs
- SchemaNames.cs
- UnmanagedMemoryStreamWrapper.cs
- ConsumerConnectionPointCollection.cs
- EventListener.cs
- PopupRootAutomationPeer.cs
- UserControl.cs
- XamlPointCollectionSerializer.cs
- CacheMemory.cs
- GeometryHitTestParameters.cs
- LicenseProviderAttribute.cs
- ProcessHostServerConfig.cs
- PkcsMisc.cs
- FrameworkReadOnlyPropertyMetadata.cs
- GridSplitter.cs
- Enum.cs
- ObjectListFieldCollection.cs
- ReaderWriterLockSlim.cs
- ProtectedConfiguration.cs
- ViewStateModeByIdAttribute.cs
- BooleanFacetDescriptionElement.cs
- OleDbFactory.cs
- DbXmlEnabledProviderManifest.cs
- InitializerFacet.cs
- LowerCaseStringConverter.cs
- Visual3D.cs
- AuthorizationRuleCollection.cs
- CurrentChangedEventManager.cs
- DependencyObjectPropertyDescriptor.cs
- PersonalizationStateQuery.cs
- DataShape.cs
- LocationSectionRecord.cs
- WebConfigurationHostFileChange.cs
- WebPartChrome.cs
- DesignerOptionService.cs
- StyleTypedPropertyAttribute.cs
- TraceContext.cs
- DataTable.cs
- XPathItem.cs
- Matrix3DConverter.cs
- TreeNodeSelectionProcessor.cs
- XPathNavigatorReader.cs
- DataGridViewRowHeaderCell.cs
- ValueSerializer.cs
- cache.cs
- formatstringdialog.cs
- PixelShader.cs
- DrawingAttributeSerializer.cs
- CodeParameterDeclarationExpression.cs
- IntSecurity.cs
- WSDualHttpSecurityElement.cs
- Viewport3DAutomationPeer.cs
- EntityViewGenerator.cs
- SQLBytesStorage.cs
- PixelFormat.cs
- VisualCollection.cs
- baseaxisquery.cs
- ByteViewer.cs
- QilNode.cs
- DataContractSerializerElement.cs
- SafeViewOfFileHandle.cs
- ObjectAnimationUsingKeyFrames.cs
- XmlReflectionImporter.cs
- BinaryObjectInfo.cs
- ResourceDisplayNameAttribute.cs
- FixedSOMElement.cs
- XPathBinder.cs
- TextTreeFixupNode.cs
- ObjectTypeMapping.cs
- HTMLTextWriter.cs
- DecimalAnimationBase.cs
- GenericTextProperties.cs
- PointAnimationUsingKeyFrames.cs
- SystemIPAddressInformation.cs
- Cursor.cs
- WorkflowMarkupSerializationException.cs
- XmlLinkedNode.cs
- TextCompositionManager.cs
- XmlAttributeAttribute.cs
- IDQuery.cs
- documentation.cs
- WindowsTitleBar.cs
- RequestCachePolicy.cs
- XpsFont.cs
- infer.cs
- LineMetrics.cs
- LocatorManager.cs
- TcpClientChannel.cs
- BasicExpandProvider.cs
- StaticSiteMapProvider.cs
- CodeFieldReferenceExpression.cs
- AlignmentYValidation.cs
- ProcessProtocolHandler.cs
- MailAddressCollection.cs
- GZipDecoder.cs
- XamlBrushSerializer.cs
- NumericUpDown.cs
- DesignerObjectListAdapter.cs
- OneOfConst.cs
- FontWeightConverter.cs