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
- ManagementEventWatcher.cs
- ItemMap.cs
- ListenerAdapter.cs
- Cursors.cs
- Trigger.cs
- safesecurityhelperavalon.cs
- ConfigXmlCDataSection.cs
- GPPOINTF.cs
- FillErrorEventArgs.cs
- XslAst.cs
- BreakRecordTable.cs
- BooleanFunctions.cs
- XamlClipboardData.cs
- DeobfuscatingStream.cs
- COSERVERINFO.cs
- SrgsElementList.cs
- SoapAttributeAttribute.cs
- MsmqIntegrationBindingElement.cs
- AxHost.cs
- UserPreferenceChangingEventArgs.cs
- TextBoxLine.cs
- SessionParameter.cs
- AssemblyResourceLoader.cs
- MailAddressCollection.cs
- DataGridViewCellValueEventArgs.cs
- SQLInt64Storage.cs
- BinarySerializer.cs
- DatagramAdapter.cs
- Pkcs9Attribute.cs
- KeyProperty.cs
- DirectoryNotFoundException.cs
- SharedStatics.cs
- AuthenticationSection.cs
- PropertyGroupDescription.cs
- LinearGradientBrush.cs
- ProcessHost.cs
- DynamicResourceExtension.cs
- PassportAuthentication.cs
- MobileSysDescriptionAttribute.cs
- WorkflowRuntimeServiceElement.cs
- HebrewNumber.cs
- ContextMenu.cs
- XPathSelfQuery.cs
- VisualStyleElement.cs
- ObjectListComponentEditor.cs
- XPathSingletonIterator.cs
- XmlSchemaDatatype.cs
- TextProperties.cs
- PageTheme.cs
- XmlElementElementCollection.cs
- Slider.cs
- TileModeValidation.cs
- OracleParameterBinding.cs
- HttpRequestCacheValidator.cs
- ColumnHeader.cs
- PropertiesTab.cs
- ContextProperty.cs
- Module.cs
- Triplet.cs
- DbProviderManifest.cs
- CompilationLock.cs
- CodeAccessPermission.cs
- __ComObject.cs
- HtmlInputPassword.cs
- RequestNavigateEventArgs.cs
- FlowDocumentPaginator.cs
- UnknownMessageReceivedEventArgs.cs
- DrawingContextWalker.cs
- FtpRequestCacheValidator.cs
- DataGridViewBindingCompleteEventArgs.cs
- TrustLevel.cs
- SHA384.cs
- WebBrowserNavigatingEventHandler.cs
- DirtyTextRange.cs
- Popup.cs
- ConfigurationStrings.cs
- QuaternionRotation3D.cs
- EventSetter.cs
- UiaCoreProviderApi.cs
- SimpleApplicationHost.cs
- TextEditorSelection.cs
- RemoteWebConfigurationHost.cs
- OperationAbortedException.cs
- CompensatableSequenceActivity.cs
- SettingsPropertyValueCollection.cs
- XmlQualifiedName.cs
- XslAstAnalyzer.cs
- MediaPlayer.cs
- SqlLiftIndependentRowExpressions.cs
- WindowsToolbarItemAsMenuItem.cs
- StylusPointDescription.cs
- ApplicationInterop.cs
- WindowsFormsLinkLabel.cs
- WindowPattern.cs
- X509Utils.cs
- DataBindingHandlerAttribute.cs
- IndicCharClassifier.cs
- ReliabilityContractAttribute.cs
- ExpressionEvaluator.cs
- TextEditor.cs