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
- OutOfProcStateClientManager.cs
- XmlSchemaSearchPattern.cs
- OpCodes.cs
- ErrorHandler.cs
- QuaternionRotation3D.cs
- Collection.cs
- OrderByExpression.cs
- PersonalizationEntry.cs
- ObjectView.cs
- ActivityExecutorOperation.cs
- Parser.cs
- XmlElement.cs
- METAHEADER.cs
- SmtpMail.cs
- RecommendedAsConfigurableAttribute.cs
- Baml2006KeyRecord.cs
- ConnectivityStatus.cs
- initElementDictionary.cs
- UTF7Encoding.cs
- DataGridComponentEditor.cs
- WebPartActionVerb.cs
- CryptoApi.cs
- DescendantBaseQuery.cs
- DictionaryEntry.cs
- SearchForVirtualItemEventArgs.cs
- ProfilePropertySettingsCollection.cs
- InternalBase.cs
- PropertyCondition.cs
- ToolStripScrollButton.cs
- XmlSchemaRedefine.cs
- IconHelper.cs
- SpecularMaterial.cs
- WsdlServiceChannelBuilder.cs
- HtmlLink.cs
- ProviderIncompatibleException.cs
- ResourceProviderFactory.cs
- AndCondition.cs
- Pen.cs
- UpdatePanel.cs
- ExpressionNode.cs
- configsystem.cs
- GroupBoxAutomationPeer.cs
- ContainsRowNumberChecker.cs
- Viewport3DAutomationPeer.cs
- FilterUserControlBase.cs
- StreamUpgradeBindingElement.cs
- ListControl.cs
- ExtensionSimplifierMarkupObject.cs
- _ProxyRegBlob.cs
- Latin1Encoding.cs
- wgx_exports.cs
- HuffCodec.cs
- DataPagerFieldCollection.cs
- ValueQuery.cs
- BooleanKeyFrameCollection.cs
- ObjectReaderCompiler.cs
- cryptoapiTransform.cs
- ArraySubsetEnumerator.cs
- ObjectDisposedException.cs
- FontSourceCollection.cs
- FileSystemEnumerable.cs
- SafePointer.cs
- IntSecurity.cs
- XamlSerializer.cs
- LogicalExpr.cs
- ControlUtil.cs
- RegexCaptureCollection.cs
- AutoGeneratedFieldProperties.cs
- OrderedDictionaryStateHelper.cs
- ScriptMethodAttribute.cs
- ExpressionNormalizer.cs
- RemoteHelper.cs
- Route.cs
- BlurBitmapEffect.cs
- OleDbSchemaGuid.cs
- SQLDecimal.cs
- Directory.cs
- HijriCalendar.cs
- EdmScalarPropertyAttribute.cs
- DataGridViewColumnTypeEditor.cs
- QueryOperatorEnumerator.cs
- SafeCryptContextHandle.cs
- IriParsingElement.cs
- SqlDataSourceSelectingEventArgs.cs
- CriticalFinalizerObject.cs
- BinaryObjectInfo.cs
- XmlDictionaryReaderQuotasElement.cs
- SQLBinary.cs
- HttpModuleActionCollection.cs
- CustomValidator.cs
- HostedHttpTransportManager.cs
- QilChoice.cs
- PropertyGeneratedEventArgs.cs
- DataGridItemCollection.cs
- UnsafeNativeMethodsTablet.cs
- PathGradientBrush.cs
- ClassValidator.cs
- ActivationServices.cs
- PixelFormat.cs
- PersonalizablePropertyEntry.cs