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
- FilteredDataSetHelper.cs
- SqlProvider.cs
- BuildProvider.cs
- TextElement.cs
- MarshalByValueComponent.cs
- ZoneMembershipCondition.cs
- TransformerTypeCollection.cs
- XmlReflectionMember.cs
- StandardToolWindows.cs
- ButtonBaseAutomationPeer.cs
- URLIdentityPermission.cs
- WebBrowserSiteBase.cs
- NameValuePair.cs
- XmlSchemaChoice.cs
- EraserBehavior.cs
- SafeRightsManagementHandle.cs
- FileDialogPermission.cs
- TraceSwitch.cs
- DataGridViewRowsRemovedEventArgs.cs
- CodeSnippetStatement.cs
- TypeBuilder.cs
- TraceHandler.cs
- SiteMapNodeCollection.cs
- ParagraphResult.cs
- LockedBorderGlyph.cs
- CheckoutException.cs
- SystemFonts.cs
- ExpressionBuilder.cs
- ADMembershipUser.cs
- CustomBindingElement.cs
- EventSinkHelperWriter.cs
- DataDocumentXPathNavigator.cs
- CounterNameConverter.cs
- HtmlInputImage.cs
- NetCodeGroup.cs
- PageParserFilter.cs
- ColorMap.cs
- Condition.cs
- HttpContextServiceHost.cs
- SchemaImporterExtensionElementCollection.cs
- precedingsibling.cs
- ErrorStyle.cs
- BamlLocalizableResource.cs
- DiscriminatorMap.cs
- CompoundFileDeflateTransform.cs
- SerializationException.cs
- Directory.cs
- UserNameSecurityToken.cs
- SpecularMaterial.cs
- TrustLevel.cs
- WizardStepCollectionEditor.cs
- DeclarativeCatalogPart.cs
- TypeConverterHelper.cs
- ComponentManagerBroker.cs
- EntityDataSourceWrapper.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- GeneralTransform3DTo2DTo3D.cs
- TextDecorationCollection.cs
- CompiledIdentityConstraint.cs
- TextBoxAutomationPeer.cs
- FixedDocument.cs
- StatusBarAutomationPeer.cs
- LayoutDump.cs
- CultureData.cs
- Group.cs
- InputMethodStateTypeInfo.cs
- AccessDataSourceView.cs
- ReadOnlyDataSourceView.cs
- TextEmbeddedObject.cs
- DataBoundControlAdapter.cs
- DelegatingTypeDescriptionProvider.cs
- StickyNoteContentControl.cs
- XmlName.cs
- BlobPersonalizationState.cs
- HttpHandlerAction.cs
- Int16.cs
- DataGridCaption.cs
- TypeSystemHelpers.cs
- SqlDependencyListener.cs
- ScrollBar.cs
- ProxyElement.cs
- StylusButton.cs
- Membership.cs
- DateTimeFormat.cs
- ToolStripArrowRenderEventArgs.cs
- DataGridRowClipboardEventArgs.cs
- ListCollectionView.cs
- TextEditorSelection.cs
- CodeAttributeDeclaration.cs
- DSASignatureFormatter.cs
- unsafenativemethodstextservices.cs
- SiteMapDesignerDataSourceView.cs
- Simplifier.cs
- AppDomainAttributes.cs
- SubstitutionList.cs
- StandardToolWindows.cs
- COM2ICategorizePropertiesHandler.cs
- XmlResolver.cs
- MsmqIntegrationReceiveParameters.cs
- URI.cs