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
- SecurityStandardsManager.cs
- ChangeTracker.cs
- CacheSection.cs
- DataGridViewRowConverter.cs
- StrongName.cs
- XPathSelfQuery.cs
- NumberFormatInfo.cs
- BinaryNode.cs
- ConstrainedDataObject.cs
- FilterableAttribute.cs
- EventListener.cs
- TextServicesPropertyRanges.cs
- EarlyBoundInfo.cs
- EtwTrace.cs
- StreamReader.cs
- CallbackHandler.cs
- SessionPageStateSection.cs
- PeerCredential.cs
- TerminatorSinks.cs
- PeerResolverMode.cs
- ReadOnlyCollection.cs
- TreeView.cs
- DataObjectAttribute.cs
- ObjectDataSourceStatusEventArgs.cs
- DataGridClipboardHelper.cs
- CustomBindingElement.cs
- SafeFindHandle.cs
- DbConnectionPoolGroup.cs
- TextEndOfLine.cs
- Keyboard.cs
- XmlCharCheckingReader.cs
- TypeHelper.cs
- ManualResetEvent.cs
- TextBlock.cs
- InvokeProviderWrapper.cs
- ConfigurationPropertyCollection.cs
- TreeNodeMouseHoverEvent.cs
- LinqDataView.cs
- GetWinFXPath.cs
- BaseInfoTable.cs
- DataControlLinkButton.cs
- UIElement.cs
- TextParagraphCache.cs
- HostedTransportConfigurationBase.cs
- ValueConversionAttribute.cs
- Soap.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- PhonemeConverter.cs
- ToolStripDesignerAvailabilityAttribute.cs
- SymbolDocumentInfo.cs
- SymbolMethod.cs
- InputScope.cs
- MemoryFailPoint.cs
- SelectionHighlightInfo.cs
- ElementProxy.cs
- PaperSource.cs
- ProviderMetadata.cs
- SortFieldComparer.cs
- DataGridCell.cs
- TextElementCollection.cs
- TraceProvider.cs
- DesignerFrame.cs
- CodeExpressionRuleDeclaration.cs
- ProjectionPruner.cs
- XmlSchemaAttributeGroup.cs
- InterleavedZipPartStream.cs
- SemanticBasicElement.cs
- SolidBrush.cs
- XpsSerializationManager.cs
- CopyNamespacesAction.cs
- ProviderUtil.cs
- BitmapEffectDrawingContextState.cs
- GenericEnumerator.cs
- MobileFormsAuthentication.cs
- ObjectStorage.cs
- XslTransformFileEditor.cs
- ContentTextAutomationPeer.cs
- ActivityInfo.cs
- Parser.cs
- StatusBarPanelClickEvent.cs
- MsmqInputSessionChannel.cs
- DecimalFormatter.cs
- DataReceivedEventArgs.cs
- WrappedIUnknown.cs
- DefaultDialogButtons.cs
- NavigationProgressEventArgs.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- DependencyPropertyDescriptor.cs
- OperationFormatStyle.cs
- SubclassTypeValidator.cs
- Marshal.cs
- AsyncCompletedEventArgs.cs
- ApplicationTrust.cs
- NativeMethods.cs
- SHA256.cs
- WindowsAuthenticationEventArgs.cs
- XmlChildEnumerator.cs
- InputLanguageEventArgs.cs
- XmlSerializerVersionAttribute.cs
- ProtocolsConfigurationHandler.cs