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
- SizeValueSerializer.cs
- regiisutil.cs
- ServerValidateEventArgs.cs
- SplitterCancelEvent.cs
- MsmqIntegrationSecurityMode.cs
- BridgeDataReader.cs
- CapabilitiesState.cs
- mil_sdk_version.cs
- ApplicationDirectoryMembershipCondition.cs
- BuildDependencySet.cs
- MasterPage.cs
- SecurityTokenSpecification.cs
- RolePrincipal.cs
- QilStrConcat.cs
- CurrencyWrapper.cs
- ContentPlaceHolder.cs
- ObjectTag.cs
- Line.cs
- TypeConverterAttribute.cs
- DataGridViewTopRowAccessibleObject.cs
- BuildProvider.cs
- ConfigXmlAttribute.cs
- SetStoryboardSpeedRatio.cs
- HttpHandlerActionCollection.cs
- X509Utils.cs
- BaseInfoTable.cs
- Clause.cs
- XmlDownloadManager.cs
- EDesignUtil.cs
- HandlerFactoryWrapper.cs
- OracleCommandBuilder.cs
- Duration.cs
- ToolStripProgressBar.cs
- objectquery_tresulttype.cs
- SecurityElement.cs
- RC2CryptoServiceProvider.cs
- TypeConverterAttribute.cs
- User.cs
- FontConverter.cs
- BindingBase.cs
- SoapHeaders.cs
- HtmlTextViewAdapter.cs
- SqlUtils.cs
- ReflectPropertyDescriptor.cs
- XmlRawWriter.cs
- WebPartEditorCancelVerb.cs
- Latin1Encoding.cs
- RegexFCD.cs
- BlurEffect.cs
- DataGridViewButtonColumn.cs
- TreeNodeCollection.cs
- ResourceContainer.cs
- FlagsAttribute.cs
- URL.cs
- ToolStripContainerActionList.cs
- EntityViewGenerator.cs
- EllipticalNodeOperations.cs
- XsdDataContractImporter.cs
- CacheMode.cs
- SqlCommand.cs
- RemoteX509Token.cs
- SchemaAttDef.cs
- DeclarativeCatalogPart.cs
- VarRefManager.cs
- _HeaderInfoTable.cs
- DispatcherSynchronizationContext.cs
- FullTextLine.cs
- XmlSequenceWriter.cs
- LineProperties.cs
- EntityModelBuildProvider.cs
- ListBoxAutomationPeer.cs
- LicenseProviderAttribute.cs
- BufferModesCollection.cs
- DiscoveryMessageSequence.cs
- HandleDictionary.cs
- OpenFileDialog.cs
- AddInAdapter.cs
- WebConvert.cs
- SmtpReplyReader.cs
- FixedTextContainer.cs
- KeySpline.cs
- PropertyMapper.cs
- CodeExpressionCollection.cs
- Token.cs
- ResourceDefaultValueAttribute.cs
- ResourcesBuildProvider.cs
- MediaTimeline.cs
- Buffer.cs
- nulltextcontainer.cs
- URIFormatException.cs
- TableParagraph.cs
- CancellationToken.cs
- SelectionListDesigner.cs
- MgmtResManager.cs
- XamlFilter.cs
- HandlerWithFactory.cs
- MarkupProperty.cs
- EntityCommandDefinition.cs
- RootNamespaceAttribute.cs
- ActivityDesignerHighlighter.cs