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
- AuthStoreRoleProvider.cs
- ValueType.cs
- SchemaManager.cs
- CustomErrorsSection.cs
- RIPEMD160Managed.cs
- Socket.cs
- Tokenizer.cs
- PolicyUnit.cs
- MemoryPressure.cs
- RadioButtonFlatAdapter.cs
- QilFactory.cs
- RegexWorker.cs
- DesignTableCollection.cs
- XmlSerializableServices.cs
- _DomainName.cs
- PingReply.cs
- OrderedDictionary.cs
- SQLDateTime.cs
- DBSqlParserTableCollection.cs
- ManualWorkflowSchedulerService.cs
- OperandQuery.cs
- SerializerWriterEventHandlers.cs
- IResourceProvider.cs
- SiteMapNode.cs
- InvalidCommandTreeException.cs
- CacheMemory.cs
- PropertyDescriptorCollection.cs
- MarkupCompilePass1.cs
- CustomAttributeSerializer.cs
- SwitchElementsCollection.cs
- StylusPointDescription.cs
- ApplicationInterop.cs
- TypeConverterMarkupExtension.cs
- datacache.cs
- IntSecurity.cs
- ResourceAttributes.cs
- RightNameExpirationInfoPair.cs
- StatusStrip.cs
- NameValueCache.cs
- shaperfactoryquerycachekey.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- MemberDomainMap.cs
- Freezable.cs
- GridErrorDlg.cs
- CertificateManager.cs
- RelationshipEntry.cs
- ActivityDefaults.cs
- FocusTracker.cs
- StringOutput.cs
- GeometryGroup.cs
- SchemaObjectWriter.cs
- TranslateTransform.cs
- VisualBasicSettings.cs
- AnimationException.cs
- ToolStripProgressBar.cs
- Block.cs
- CurrentTimeZone.cs
- RadioButtonPopupAdapter.cs
- CfgParser.cs
- RootBrowserWindowAutomationPeer.cs
- EventLog.cs
- StrokeCollection.cs
- HttpListenerRequest.cs
- PeerObject.cs
- XmlDocumentType.cs
- ExpanderAutomationPeer.cs
- ConfigurationConverterBase.cs
- UIAgentCrashedException.cs
- ToolStripContentPanelRenderEventArgs.cs
- DoubleKeyFrameCollection.cs
- StatusBar.cs
- LinkConverter.cs
- SymbolResolver.cs
- DefaultCompensation.cs
- WindowsTreeView.cs
- TextMarkerSource.cs
- TextServicesCompartmentEventSink.cs
- ObsoleteAttribute.cs
- MenuBindingsEditorForm.cs
- GridView.cs
- ReliabilityContractAttribute.cs
- DelayLoadType.cs
- BuilderInfo.cs
- TemplatedAdorner.cs
- SQLMembershipProvider.cs
- PnrpPermission.cs
- ObjectListFieldCollection.cs
- LinkedResource.cs
- GridLength.cs
- SourceInterpreter.cs
- TextBoxBase.cs
- ActivationProxy.cs
- StaticTextPointer.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- SqlDataSourceTableQuery.cs
- Tag.cs
- KeyInterop.cs
- CompilerParameters.cs
- XmlNamespaceMappingCollection.cs
- BooleanToVisibilityConverter.cs