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
- MulticastIPAddressInformationCollection.cs
- QueryOutputWriterV1.cs
- StreamSecurityUpgradeInitiatorAsyncResult.cs
- ProtectedConfiguration.cs
- AssociationSetMetadata.cs
- DataViewSettingCollection.cs
- GZipDecoder.cs
- HealthMonitoringSectionHelper.cs
- DataGridViewRowPostPaintEventArgs.cs
- ConfigurationManagerInternalFactory.cs
- Soap12ProtocolReflector.cs
- UInt16Storage.cs
- GraphicsPath.cs
- StateMachineTimers.cs
- ShapingWorkspace.cs
- StringFormat.cs
- TagPrefixAttribute.cs
- SqlDataSourceCommandEventArgs.cs
- DesignOnlyAttribute.cs
- IfAction.cs
- Tablet.cs
- WebSysDisplayNameAttribute.cs
- FlowDocumentPageViewerAutomationPeer.cs
- AddInToken.cs
- SmtpMail.cs
- HandlerWithFactory.cs
- LinkUtilities.cs
- Matrix3D.cs
- unsafenativemethodstextservices.cs
- AssemblyName.cs
- CreateUserErrorEventArgs.cs
- SemaphoreFullException.cs
- HScrollBar.cs
- FixedElement.cs
- ImportOptions.cs
- Typeface.cs
- TimeSpanValidatorAttribute.cs
- ResolveResponseInfo.cs
- UDPClient.cs
- HttpCachePolicyElement.cs
- OutputCacheSection.cs
- DataGridRow.cs
- TraceShell.cs
- DataSvcMapFileSerializer.cs
- ValueTypeFixupInfo.cs
- SkinBuilder.cs
- EntityParameterCollection.cs
- DependencyObjectProvider.cs
- WindowsGraphicsWrapper.cs
- DynamicEntity.cs
- NativeMethods.cs
- DriveInfo.cs
- CommonDialog.cs
- QualifiedId.cs
- ArrayTypeMismatchException.cs
- ConfigDefinitionUpdates.cs
- SignatureDescription.cs
- CodeGenerator.cs
- RoleManagerEventArgs.cs
- Rules.cs
- BindMarkupExtensionSerializer.cs
- Expander.cs
- GridItemPattern.cs
- DesignerActionGlyph.cs
- QilList.cs
- PreviousTrackingServiceAttribute.cs
- EdmMember.cs
- CodeObject.cs
- MessageHeaderAttribute.cs
- GeneralTransform2DTo3DTo2D.cs
- HTMLTagNameToTypeMapper.cs
- InstanceDataCollectionCollection.cs
- UnmanagedMemoryStream.cs
- InternalBufferOverflowException.cs
- DocumentPageView.cs
- XmlC14NWriter.cs
- ToolStripItemTextRenderEventArgs.cs
- WsatConfiguration.cs
- WebPartZoneCollection.cs
- FileSecurity.cs
- X509Certificate.cs
- ReadOnlyCollectionBuilder.cs
- ColorContext.cs
- Authorization.cs
- UnsafeNativeMethods.cs
- TimeSpanStorage.cs
- OleDbRowUpdatingEvent.cs
- BidirectionalDictionary.cs
- UriParserTemplates.cs
- EnumBuilder.cs
- DataFieldEditor.cs
- QualifiedCellIdBoolean.cs
- ZipArchive.cs
- DbRetry.cs
- HandleRef.cs
- InputLanguageCollection.cs
- EmptyStringExpandableObjectConverter.cs
- ImageInfo.cs
- BitmapEffectDrawingContextWalker.cs
- ScrollBar.cs