Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / clr / src / BCL / System / Security / Cryptography / KeyedHashAlgorithm.cs / 1 / KeyedHashAlgorithm.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // KeyedHashAlgorithm.cs // namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public abstract class KeyedHashAlgorithm : HashAlgorithm { protected byte[] KeyValue; protected KeyedHashAlgorithm() {} // IDisposable methods protected override void Dispose(bool disposing) { // For keyed hash algorithms, we always want to zero out the key value if (disposing) { if (KeyValue != null) Array.Clear(KeyValue, 0, KeyValue.Length); KeyValue = null; } base.Dispose(disposing); } // // public properties // public virtual byte[] Key { get { return (byte[]) KeyValue.Clone(); } set { if (State != 0) throw new CryptographicException(Environment.GetResourceString("Cryptography_HashKeySet")); KeyValue = (byte[]) value.Clone(); } } // // public methods // new static public KeyedHashAlgorithm Create() { return Create("System.Security.Cryptography.KeyedHashAlgorithm"); } new static public KeyedHashAlgorithm Create(String algName) { return (KeyedHashAlgorithm) CryptoConfig.CreateFromName(algName); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // KeyedHashAlgorithm.cs // namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public abstract class KeyedHashAlgorithm : HashAlgorithm { protected byte[] KeyValue; protected KeyedHashAlgorithm() {} // IDisposable methods protected override void Dispose(bool disposing) { // For keyed hash algorithms, we always want to zero out the key value if (disposing) { if (KeyValue != null) Array.Clear(KeyValue, 0, KeyValue.Length); KeyValue = null; } base.Dispose(disposing); } // // public properties // public virtual byte[] Key { get { return (byte[]) KeyValue.Clone(); } set { if (State != 0) throw new CryptographicException(Environment.GetResourceString("Cryptography_HashKeySet")); KeyValue = (byte[]) value.Clone(); } } // // public methods // new static public KeyedHashAlgorithm Create() { return Create("System.Security.Cryptography.KeyedHashAlgorithm"); } new static public KeyedHashAlgorithm Create(String algName) { return (KeyedHashAlgorithm) CryptoConfig.CreateFromName(algName); } } } // 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
- ToolStripItemImageRenderEventArgs.cs
- ObjectItemNoOpAssemblyLoader.cs
- TriggerAction.cs
- ListControlStringCollectionEditor.cs
- DetailsViewDesigner.cs
- ThreadStaticAttribute.cs
- InternalCache.cs
- MonthChangedEventArgs.cs
- ToolStripPanelRow.cs
- WebPartCloseVerb.cs
- COM2ColorConverter.cs
- MenuCommand.cs
- MsmqHostedTransportConfiguration.cs
- IntranetCredentialPolicy.cs
- LongMinMaxAggregationOperator.cs
- DataGridViewImageColumn.cs
- __Filters.cs
- UnsafeNativeMethods.cs
- PlatformCulture.cs
- TimeManager.cs
- BitmapFrameDecode.cs
- DbConnectionPoolOptions.cs
- IteratorFilter.cs
- ExpressionPrefixAttribute.cs
- Tokenizer.cs
- SystemDropShadowChrome.cs
- XamlStyleSerializer.cs
- CompositeCollection.cs
- DoubleStorage.cs
- ListControlConvertEventArgs.cs
- CryptoApi.cs
- QueryAccessibilityHelpEvent.cs
- GradientStopCollection.cs
- ZipQueryOperator.cs
- ParameterBuilder.cs
- GridViewRow.cs
- TaskFileService.cs
- Comparer.cs
- QueryableDataSourceView.cs
- SizeValueSerializer.cs
- AssemblyName.cs
- XPathArrayIterator.cs
- XmlSchemaChoice.cs
- XmlCollation.cs
- RequestTimeoutManager.cs
- SqlOuterApplyReducer.cs
- UnknownWrapper.cs
- XmlBufferReader.cs
- LinkClickEvent.cs
- DataShape.cs
- ResizeGrip.cs
- GenericFlowSwitchHelper.cs
- DbModificationCommandTree.cs
- Win32.cs
- PageResolution.cs
- DrawingVisualDrawingContext.cs
- ScriptManagerProxy.cs
- SBCSCodePageEncoding.cs
- CombinedGeometry.cs
- HWStack.cs
- HttpGetServerProtocol.cs
- FocusChangedEventArgs.cs
- OverflowException.cs
- PageBorderless.cs
- SplitContainer.cs
- GradientStop.cs
- DesignerActionMethodItem.cs
- ConfigsHelper.cs
- PenThread.cs
- ObjectTag.cs
- ScrollBarRenderer.cs
- XamlTypeMapper.cs
- ClientOptions.cs
- WebPartRestoreVerb.cs
- CounterCreationData.cs
- WebZone.cs
- KeyTimeConverter.cs
- TextMarkerSource.cs
- DSASignatureDeformatter.cs
- TdsParserStaticMethods.cs
- TextCharacters.cs
- FlowDocumentPage.cs
- InkCanvasFeedbackAdorner.cs
- SoapAttributeAttribute.cs
- safelinkcollection.cs
- Journaling.cs
- Activator.cs
- BitmapMetadata.cs
- DBPropSet.cs
- XmlSerializationGeneratedCode.cs
- DynamicResourceExtensionConverter.cs
- HandlerMappingMemo.cs
- InstanceNotFoundException.cs
- RawAppCommandInputReport.cs
- ContentElementAutomationPeer.cs
- RegularExpressionValidator.cs
- CategoryNameCollection.cs
- DesignerTextBoxAdapter.cs
- RoutedEventArgs.cs
- CallbackWrapper.cs