Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Security / Cryptography / SHA256Cng.cs / 1305376 / SHA256Cng.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-256 hashing algorithm /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class SHA256Cng : SHA256 { private BCryptHashAlgorithm m_hashAlgorithm; //// [System.Security.SecurityCritical] public SHA256Cng() { Contract.Ensures(m_hashAlgorithm != null); m_hashAlgorithm = new BCryptHashAlgorithm(CngAlgorithm.Sha256, 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
- DynamicPropertyHolder.cs
- MaskedTextBoxDesignerActionList.cs
- DebugHandleTracker.cs
- TextRenderer.cs
- Color.cs
- XPathScanner.cs
- AppPool.cs
- TabRenderer.cs
- _ListenerRequestStream.cs
- GeneralTransformCollection.cs
- DbConnectionPoolIdentity.cs
- Vertex.cs
- PropertyChangedEventManager.cs
- StorageAssociationSetMapping.cs
- SystemThemeKey.cs
- NativeMethods.cs
- TemplateAction.cs
- Lazy.cs
- DesignerForm.cs
- PrintEvent.cs
- _ConnectOverlappedAsyncResult.cs
- XsdBuildProvider.cs
- UserValidatedEventArgs.cs
- HyperLinkColumn.cs
- HwndKeyboardInputProvider.cs
- WizardForm.cs
- ConfigurationLocation.cs
- IdentityValidationException.cs
- LinkTarget.cs
- BaseTemplateCodeDomTreeGenerator.cs
- TransformerTypeCollection.cs
- _OverlappedAsyncResult.cs
- DesignTimeData.cs
- XmlSchemaParticle.cs
- TemplateEditingVerb.cs
- ComponentCommands.cs
- TranslateTransform.cs
- XamlReaderHelper.cs
- DateTimeFormatInfoScanner.cs
- XNodeNavigator.cs
- SapiAttributeParser.cs
- SystemParameters.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- UrlMappingsSection.cs
- ChannelDemuxer.cs
- OleDbException.cs
- DynamicValueConverter.cs
- cookieexception.cs
- FloatAverageAggregationOperator.cs
- CreatingCookieEventArgs.cs
- SyncOperationState.cs
- OrderByExpression.cs
- Baml2006Reader.cs
- EntityChangedParams.cs
- BindStream.cs
- LocationSectionRecord.cs
- TextShapeableCharacters.cs
- DataTableClearEvent.cs
- AspNetHostingPermission.cs
- BamlTreeMap.cs
- HwndSourceKeyboardInputSite.cs
- XmlElementAttributes.cs
- WinEventHandler.cs
- NumberFunctions.cs
- WithParamAction.cs
- CompiledRegexRunner.cs
- ActivityXRefPropertyEditor.cs
- printdlgexmarshaler.cs
- SHA384Managed.cs
- NegotiationTokenAuthenticator.cs
- PropertyGridDesigner.cs
- hresults.cs
- TextReturnReader.cs
- SiteMembershipCondition.cs
- XpsFontSerializationService.cs
- FontStretchConverter.cs
- ExtensionFile.cs
- regiisutil.cs
- HttpRequestWrapper.cs
- __Filters.cs
- ToolStripDropDownMenu.cs
- HandlerFactoryWrapper.cs
- OraclePermission.cs
- RayHitTestParameters.cs
- ISO2022Encoding.cs
- TransportChannelFactory.cs
- ListBoxAutomationPeer.cs
- XmlSchemaFacet.cs
- ToolStripDropDownMenu.cs
- TimeSpanMinutesConverter.cs
- NullNotAllowedCollection.cs
- counter.cs
- Command.cs
- XmlSiteMapProvider.cs
- LoadItemsEventArgs.cs
- EncryptedXml.cs
- IndexedString.cs
- AnonymousIdentificationModule.cs
- MaskDescriptor.cs
- CuspData.cs