Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- TypeContext.cs
- SimpleWebHandlerParser.cs
- DefaultSerializationProviderAttribute.cs
- WrapPanel.cs
- Cursor.cs
- LinearKeyFrames.cs
- FragmentQueryKB.cs
- StringValueSerializer.cs
- HotSpotCollection.cs
- CommandManager.cs
- OrderedDictionaryStateHelper.cs
- mediaeventargs.cs
- PerformanceCounterPermissionEntry.cs
- ParenthesizePropertyNameAttribute.cs
- SymLanguageType.cs
- ControlUtil.cs
- RectangleGeometry.cs
- Soap12ProtocolReflector.cs
- DBBindings.cs
- CardSpaceSelector.cs
- ExtendedProperty.cs
- TextBox.cs
- SqlConnectionHelper.cs
- ServiceHost.cs
- BuildResultCache.cs
- DataRelationCollection.cs
- InternalsVisibleToAttribute.cs
- DataRecordObjectView.cs
- SerialPort.cs
- XmlSortKeyAccumulator.cs
- ValuePattern.cs
- ViewSimplifier.cs
- CorrelationScope.cs
- ListViewCommandEventArgs.cs
- MgmtConfigurationRecord.cs
- HttpHandlerActionCollection.cs
- DiagnosticSection.cs
- RequestNavigateEventArgs.cs
- FtpRequestCacheValidator.cs
- SelectionUIHandler.cs
- SafeWaitHandle.cs
- SqlInternalConnection.cs
- ValidationEventArgs.cs
- FormsIdentity.cs
- iisPickupDirectory.cs
- WindowsContainer.cs
- HMACSHA384.cs
- IDReferencePropertyAttribute.cs
- WorkflowWebService.cs
- ScriptControlManager.cs
- XsltFunctions.cs
- _NtlmClient.cs
- safex509handles.cs
- StreamSecurityUpgradeProvider.cs
- HttpTransportBindingElement.cs
- TriState.cs
- BinaryWriter.cs
- DragDeltaEventArgs.cs
- TextComposition.cs
- XmlQuerySequence.cs
- TypeReference.cs
- BroadcastEventHelper.cs
- KeyPressEvent.cs
- XmlResolver.cs
- DynamicScriptObject.cs
- Header.cs
- VirtualDirectoryMappingCollection.cs
- XmlSchemaAny.cs
- BamlBinaryReader.cs
- CacheMemory.cs
- DocumentSchemaValidator.cs
- ObjectDataSourceMethodEventArgs.cs
- ExpressionBuilderCollection.cs
- EmbossBitmapEffect.cs
- SimpleTextLine.cs
- RecognizedPhrase.cs
- ContentPlaceHolderDesigner.cs
- Filter.cs
- AddInController.cs
- SoapFault.cs
- GroupQuery.cs
- Pointer.cs
- StorageInfo.cs
- ConnectionStringSettingsCollection.cs
- DataListItemEventArgs.cs
- ComponentDispatcherThread.cs
- dataobject.cs
- BamlRecordReader.cs
- FixedDSBuilder.cs
- EnumMember.cs
- PowerModeChangedEventArgs.cs
- BoolExpr.cs
- XPathExpr.cs
- Point3DAnimationBase.cs
- WmpBitmapEncoder.cs
- ListViewTableRow.cs
- Vector3DValueSerializer.cs
- SessionState.cs
- TopClause.cs
- ComboBoxRenderer.cs