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
- KerberosSecurityTokenProvider.cs
- AsyncStreamReader.cs
- UriExt.cs
- MostlySingletonList.cs
- ConsoleCancelEventArgs.cs
- ValueTable.cs
- RoleExceptions.cs
- SoapCodeExporter.cs
- SharedStream.cs
- GenericIdentity.cs
- LinkedResource.cs
- ApplicationProxyInternal.cs
- DefaultMemberAttribute.cs
- FusionWrap.cs
- LingerOption.cs
- WindowHideOrCloseTracker.cs
- ImportedNamespaceContextItem.cs
- XmlProcessingInstruction.cs
- ping.cs
- UnsafeNetInfoNativeMethods.cs
- ProvideValueServiceProvider.cs
- SvcMapFileSerializer.cs
- TextWriter.cs
- WindowsAuthenticationEventArgs.cs
- RunWorkerCompletedEventArgs.cs
- RemotingException.cs
- HttpCachePolicyElement.cs
- VectorCollectionConverter.cs
- SerializationEventsCache.cs
- Part.cs
- MaskDescriptor.cs
- WebPartConnectionsCancelVerb.cs
- ActivityTypeCodeDomSerializer.cs
- StorageInfo.cs
- SuspendDesigner.cs
- Pen.cs
- AnimationTimeline.cs
- Marshal.cs
- XmlCharCheckingWriter.cs
- XhtmlConformanceSection.cs
- TriggerCollection.cs
- MethodAccessException.cs
- Rotation3D.cs
- ProvidersHelper.cs
- KeyPressEvent.cs
- MonthChangedEventArgs.cs
- RtType.cs
- ValuePatternIdentifiers.cs
- HttpHandlerActionCollection.cs
- SecurityDocument.cs
- RemoteWebConfigurationHostServer.cs
- JsonMessageEncoderFactory.cs
- DictionaryBase.cs
- TextAnchor.cs
- ListViewAutomationPeer.cs
- UriParserTemplates.cs
- FlowDocumentReader.cs
- NumberFunctions.cs
- ImpersonateTokenRef.cs
- CssTextWriter.cs
- NameValueSectionHandler.cs
- PermissionListSet.cs
- TextAutomationPeer.cs
- FontCollection.cs
- BaseDataBoundControl.cs
- SpellerInterop.cs
- XmlEncodedRawTextWriter.cs
- SqlTransaction.cs
- CommandField.cs
- ImageListDesigner.cs
- InputLanguageProfileNotifySink.cs
- Int32Animation.cs
- DynamicMetaObject.cs
- ScriptRegistrationManager.cs
- Converter.cs
- XmlMessageFormatter.cs
- SqlNotificationEventArgs.cs
- WebPartVerbsEventArgs.cs
- httpstaticobjectscollection.cs
- CodeStatement.cs
- ExtractorMetadata.cs
- IPGlobalProperties.cs
- SyndicationSerializer.cs
- WebControl.cs
- XPathChildIterator.cs
- DropDownHolder.cs
- DataSetUtil.cs
- FormViewPagerRow.cs
- DataServiceStreamProviderWrapper.cs
- ObjectTag.cs
- NamespaceInfo.cs
- UnmanagedMarshal.cs
- SnapLine.cs
- EntityFrameworkVersions.cs
- SecurityContextSecurityTokenAuthenticator.cs
- wgx_commands.cs
- ScriptReference.cs
- WebPartManager.cs
- SafeProcessHandle.cs
- FontConverter.cs