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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GridEntryCollection.cs
- ErrorLog.cs
- MouseCaptureWithinProperty.cs
- AuthenticationException.cs
- HttpListenerRequest.cs
- FixedTextBuilder.cs
- ToolBarDesigner.cs
- QfeChecker.cs
- PriorityRange.cs
- X509CertificateValidator.cs
- WebBaseEventKeyComparer.cs
- PackagePart.cs
- SmtpDigestAuthenticationModule.cs
- IProvider.cs
- UriSection.cs
- JoinElimination.cs
- Predicate.cs
- MetaDataInfo.cs
- OpacityConverter.cs
- TextDecorationCollection.cs
- Rules.cs
- SystemDiagnosticsSection.cs
- DataGridPagingPage.cs
- PatternMatcher.cs
- ISessionStateStore.cs
- Thumb.cs
- PeerValidationBehavior.cs
- WebPart.cs
- StickyNoteAnnotations.cs
- TextParagraphCache.cs
- GeneralTransformGroup.cs
- TypePropertyEditor.cs
- securitycriticaldataClass.cs
- ControlDesignerState.cs
- LoginCancelEventArgs.cs
- COM2ExtendedTypeConverter.cs
- Vector3DCollection.cs
- Point3DConverter.cs
- ExpressionList.cs
- DbProviderFactories.cs
- SHA384Managed.cs
- AxHost.cs
- DefaultBindingPropertyAttribute.cs
- unsafeIndexingFilterStream.cs
- NetworkInformationException.cs
- CachedBitmap.cs
- SignedXmlDebugLog.cs
- PropertyToken.cs
- dataobject.cs
- BufferedGraphics.cs
- PageThemeParser.cs
- MultiSelectRootGridEntry.cs
- DataSpaceManager.cs
- AsyncPostBackErrorEventArgs.cs
- DefaultValueConverter.cs
- QuaternionAnimationBase.cs
- StorageConditionPropertyMapping.cs
- TypeSystem.cs
- ZipIOLocalFileDataDescriptor.cs
- recordstatefactory.cs
- InputEventArgs.cs
- TableProviderWrapper.cs
- DisposableCollectionWrapper.cs
- SqlFormatter.cs
- StaticSiteMapProvider.cs
- Int32Converter.cs
- MissingMethodException.cs
- ScaleTransform.cs
- MatrixCamera.cs
- SchemaSetCompiler.cs
- PreviewKeyDownEventArgs.cs
- SortDescription.cs
- SecurityTokenException.cs
- HyperlinkAutomationPeer.cs
- AutoSizeToolBoxItem.cs
- RegexBoyerMoore.cs
- StateRuntime.cs
- RemotingConfigParser.cs
- UserPersonalizationStateInfo.cs
- TextPointerBase.cs
- DiscoveryReference.cs
- mediaclock.cs
- LinkClickEvent.cs
- CustomExpression.cs
- DocumentAutomationPeer.cs
- WindowsRichEdit.cs
- WorkItem.cs
- NumericExpr.cs
- ProxyWebPartConnectionCollection.cs
- _SslSessionsCache.cs
- WorkflowInstanceUnhandledExceptionRecord.cs
- SamlAssertionDirectKeyIdentifierClause.cs
- TextProperties.cs
- HostSecurityManager.cs
- DataSourceNameHandler.cs
- ItemDragEvent.cs
- BufferedReadStream.cs
- CheckBoxPopupAdapter.cs
- lengthconverter.cs
- IUnknownConstantAttribute.cs