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
- WizardForm.cs
- ReadWriteSpinLock.cs
- DataConnectionHelper.cs
- MeshGeometry3D.cs
- DataPager.cs
- FileVersionInfo.cs
- JumpTask.cs
- ObjectDataSourceEventArgs.cs
- ChannelSinkStacks.cs
- ToolStripComboBox.cs
- OdbcTransaction.cs
- OleStrCAMarshaler.cs
- VariantWrapper.cs
- LogicalExpr.cs
- ColorConverter.cs
- UpdatableGenericsFeature.cs
- GeometryGroup.cs
- DiscoveryServerProtocol.cs
- List.cs
- WebPartCancelEventArgs.cs
- TreeNodeCollection.cs
- ComponentEditorPage.cs
- coordinator.cs
- CatalogPartChrome.cs
- BasicCellRelation.cs
- EntityDataReader.cs
- IPGlobalProperties.cs
- DebugInfo.cs
- Merger.cs
- ShapeTypeface.cs
- Span.cs
- AuthStoreRoleProvider.cs
- EnterpriseServicesHelper.cs
- HotSpotCollection.cs
- DefaultPropertyAttribute.cs
- CharAnimationUsingKeyFrames.cs
- ThicknessConverter.cs
- VirtualizedCellInfoCollection.cs
- IdentitySection.cs
- ChtmlTextWriter.cs
- CodeSnippetCompileUnit.cs
- LocalFileSettingsProvider.cs
- InputMethod.cs
- ImageMapEventArgs.cs
- LayoutUtils.cs
- SmiEventSink_DeferedProcessing.cs
- ReachFixedPageSerializerAsync.cs
- FormClosedEvent.cs
- CalendarDateRange.cs
- MultilineStringConverter.cs
- OracleBFile.cs
- CodeCommentStatementCollection.cs
- TransformerInfoCollection.cs
- ResumeStoryboard.cs
- TransformPattern.cs
- XmlObjectSerializerReadContextComplex.cs
- ContourSegment.cs
- ControlBuilderAttribute.cs
- DbMetaDataFactory.cs
- RC2CryptoServiceProvider.cs
- Variable.cs
- KeyTime.cs
- ImmutableCollection.cs
- DataSourceXmlTextReader.cs
- FamilyTypeface.cs
- SemanticKeyElement.cs
- keycontainerpermission.cs
- Sql8ConformanceChecker.cs
- ByteAnimationUsingKeyFrames.cs
- StrokeSerializer.cs
- DeviceOverridableAttribute.cs
- CacheEntry.cs
- XmlCharacterData.cs
- FieldTemplateFactory.cs
- ObjectContextServiceProvider.cs
- TableChangeProcessor.cs
- StackOverflowException.cs
- DeflateStream.cs
- CallContext.cs
- RuntimeConfig.cs
- XmlSchemaComplexContentExtension.cs
- ProfileSection.cs
- IssuedTokenParametersEndpointAddressElement.cs
- IndexObject.cs
- Translator.cs
- TargetControlTypeCache.cs
- HorizontalAlignConverter.cs
- ResourceIDHelper.cs
- CqlBlock.cs
- ExtendLockAsyncResult.cs
- TextEncodedRawTextWriter.cs
- MemberInfoSerializationHolder.cs
- AttributedMetaModel.cs
- IPGlobalProperties.cs
- XmlSerializableReader.cs
- EventRoute.cs
- LogStream.cs
- SynchronizedDispatch.cs
- ColorBlend.cs
- LayoutUtils.cs