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
- SkipStoryboardToFill.cs
- XmlSignatureProperties.cs
- SmtpNetworkElement.cs
- DEREncoding.cs
- ResXResourceReader.cs
- DispatcherProcessingDisabled.cs
- RenamedEventArgs.cs
- DesignerView.cs
- PagedDataSource.cs
- SettingsContext.cs
- TypeExtensionConverter.cs
- CustomWebEventKey.cs
- DispatchChannelSink.cs
- StrokeIntersection.cs
- ImageBrush.cs
- LinkLabelLinkClickedEvent.cs
- FontWeights.cs
- SymbolDocumentInfo.cs
- SmtpReplyReaderFactory.cs
- sqlinternaltransaction.cs
- UnsafeNativeMethodsTablet.cs
- AutomationFocusChangedEventArgs.cs
- HiddenField.cs
- TypeSemantics.cs
- EntityProxyTypeInfo.cs
- XamlSerializer.cs
- UrlPropertyAttribute.cs
- ToolStripKeyboardHandlingService.cs
- WinEventQueueItem.cs
- PageCodeDomTreeGenerator.cs
- EmbeddedObject.cs
- WindowsSlider.cs
- COM2PropertyPageUITypeConverter.cs
- GlobalEventManager.cs
- TemplateBindingExtension.cs
- SQLChars.cs
- RunClient.cs
- FieldNameLookup.cs
- Rect3DValueSerializer.cs
- SafeFileMappingHandle.cs
- ConfigurationSection.cs
- ToolStripContainer.cs
- HighContrastHelper.cs
- MergePropertyDescriptor.cs
- XmlSignificantWhitespace.cs
- OleDbConnectionInternal.cs
- ValidationResult.cs
- XmlParserContext.cs
- OdbcError.cs
- SHA256.cs
- HtmlInputControl.cs
- DBParameter.cs
- RefreshEventArgs.cs
- ImageListStreamer.cs
- PersonalizableTypeEntry.cs
- HttpException.cs
- FormatSettings.cs
- XamlToRtfWriter.cs
- GeometryCollection.cs
- CompositeActivityTypeDescriptor.cs
- ColorAnimationBase.cs
- BooleanAnimationBase.cs
- TreeViewItem.cs
- XmlSchemaComplexContentRestriction.cs
- PcmConverter.cs
- DataList.cs
- BuildProviderCollection.cs
- ThrowHelper.cs
- DrawListViewColumnHeaderEventArgs.cs
- SiteMembershipCondition.cs
- SessionParameter.cs
- entityreference_tresulttype.cs
- PackageStore.cs
- DBCommand.cs
- EdmConstants.cs
- ModelItemKeyValuePair.cs
- hebrewshape.cs
- DBSchemaRow.cs
- TimelineClockCollection.cs
- SessionPageStateSection.cs
- TypeDescriptionProviderAttribute.cs
- ComPlusAuthorization.cs
- AssemblyUtil.cs
- SchemaNames.cs
- ReadOnlyDictionary.cs
- DesignerActionPanel.cs
- Speller.cs
- ProxyGenerationError.cs
- TextServicesCompartment.cs
- SiteMapSection.cs
- OutputCacheSection.cs
- PageAsyncTaskManager.cs
- LinearGradientBrush.cs
- TextBoxAutoCompleteSourceConverter.cs
- DesignerMetadata.cs
- DataComponentGenerator.cs
- BinaryObjectInfo.cs
- RelationshipEndCollection.cs
- InstanceOwner.cs
- CustomError.cs