Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Cryptography / KeyedHashAlgorithm.cs / 1305376 / 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 // [System.Security.SecuritySafeCritical] // auto-generated new static public KeyedHashAlgorithm Create() { return Create("System.Security.Cryptography.KeyedHashAlgorithm"); } [System.Security.SecuritySafeCritical] // auto-generated 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 // [System.Security.SecuritySafeCritical] // auto-generated new static public KeyedHashAlgorithm Create() { return Create("System.Security.Cryptography.KeyedHashAlgorithm"); } [System.Security.SecuritySafeCritical] // auto-generated 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
- SynchronizationFilter.cs
- AlternateViewCollection.cs
- StringValueSerializer.cs
- SHA1Managed.cs
- ConfigurationSection.cs
- Currency.cs
- Geometry3D.cs
- InfiniteIntConverter.cs
- PackUriHelper.cs
- PassportPrincipal.cs
- DoubleLink.cs
- SchemaName.cs
- FactoryRecord.cs
- Hash.cs
- MissingMethodException.cs
- Convert.cs
- TypeConverterAttribute.cs
- SkipStoryboardToFill.cs
- DatagridviewDisplayedBandsData.cs
- HtmlTernaryTree.cs
- HtmlInputButton.cs
- AddInIpcChannel.cs
- EncoderFallback.cs
- SeverityFilter.cs
- AnonymousIdentificationModule.cs
- IsolatedStorageFilePermission.cs
- FixUp.cs
- COAUTHIDENTITY.cs
- CloudCollection.cs
- DictionaryGlobals.cs
- WindowsGraphicsCacheManager.cs
- Stroke.cs
- DriveNotFoundException.cs
- UserPreferenceChangedEventArgs.cs
- ZipIOExtraFieldPaddingElement.cs
- LocalizationParserHooks.cs
- ActivityExecutionContext.cs
- ListViewGroupConverter.cs
- PropertyChange.cs
- _TimerThread.cs
- AutomationPattern.cs
- SystemInformation.cs
- SafeLibraryHandle.cs
- XmlDataCollection.cs
- RowCache.cs
- XPathNodeHelper.cs
- HttpListenerRequest.cs
- ThreadSafeList.cs
- sapiproxy.cs
- SafeEventLogWriteHandle.cs
- BindingExpressionUncommonField.cs
- ContentPlaceHolder.cs
- RawStylusSystemGestureInputReport.cs
- GridSplitter.cs
- ResourceContainer.cs
- XslVisitor.cs
- XmlElementAttributes.cs
- MetadataItemEmitter.cs
- ConfigurationPermission.cs
- StringStorage.cs
- TypeProvider.cs
- ToolStripDropDownClosedEventArgs.cs
- BackStopAuthenticationModule.cs
- SmtpAuthenticationManager.cs
- LabelAutomationPeer.cs
- DataTransferEventArgs.cs
- RequestChannelBinder.cs
- LinqTreeNodeEvaluator.cs
- ProcessInputEventArgs.cs
- AdapterUtil.cs
- WebZone.cs
- LightweightEntityWrapper.cs
- AsyncPostBackErrorEventArgs.cs
- DataTemplate.cs
- ToolbarAUtomationPeer.cs
- AtlasWeb.Designer.cs
- SerializationObjectManager.cs
- SuppressIldasmAttribute.cs
- ResourcePermissionBase.cs
- LinkedResource.cs
- Timer.cs
- complextypematerializer.cs
- GeneralTransform2DTo3D.cs
- SerializationInfo.cs
- WindowShowOrOpenTracker.cs
- Calendar.cs
- WebReference.cs
- RsaElement.cs
- cookie.cs
- TextModifierScope.cs
- XPathMessageFilterTable.cs
- x509store.cs
- XPathNodeInfoAtom.cs
- compensatingcollection.cs
- SynchronizationLockException.cs
- CategoryGridEntry.cs
- TransformedBitmap.cs
- IncrementalReadDecoders.cs
- DataGrid.cs
- WebRequestModuleElementCollection.cs