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
- SharedStatics.cs
- TextHidden.cs
- SrgsToken.cs
- IdlingCommunicationPool.cs
- CompilerTypeWithParams.cs
- GlobalItem.cs
- NullPackagingPolicy.cs
- StructuralObject.cs
- TextModifierScope.cs
- DataSourceProvider.cs
- TextEffectResolver.cs
- KernelTypeValidation.cs
- QuerySafeNavigator.cs
- Dispatcher.cs
- QuaternionAnimation.cs
- Timeline.cs
- TypeSystemHelpers.cs
- ToolStripDropDownMenu.cs
- FindProgressChangedEventArgs.cs
- CalendarDataBindingHandler.cs
- Int16AnimationBase.cs
- GeometryModel3D.cs
- MethodAccessException.cs
- DescendantOverDescendantQuery.cs
- DataFieldEditor.cs
- glyphs.cs
- ToolBar.cs
- WebServicesSection.cs
- Expression.cs
- storepermissionattribute.cs
- MatrixUtil.cs
- DecryptRequest.cs
- tooltip.cs
- SimpleModelProvider.cs
- CoTaskMemSafeHandle.cs
- SecondaryViewProvider.cs
- WebResourceAttribute.cs
- OdbcConnectionFactory.cs
- GraphicsContainer.cs
- TextModifierScope.cs
- InvalidComObjectException.cs
- ListCardsInFileRequest.cs
- XmlSchemaElement.cs
- DBSchemaRow.cs
- ApplicationManager.cs
- Mutex.cs
- RemotingAttributes.cs
- MatrixAnimationUsingPath.cs
- XamlWriter.cs
- SHA512CryptoServiceProvider.cs
- RequestSecurityTokenResponse.cs
- ByteAnimationBase.cs
- AutomationTextAttribute.cs
- MediaScriptCommandRoutedEventArgs.cs
- TableStyle.cs
- CheckBoxDesigner.cs
- DataServiceQuery.cs
- DBDataPermissionAttribute.cs
- FileDialog_Vista.cs
- ButtonBase.cs
- PenLineJoinValidation.cs
- FrugalMap.cs
- AppDomain.cs
- Dump.cs
- WebPartVerbCollection.cs
- DatePickerDateValidationErrorEventArgs.cs
- TypeHelpers.cs
- TakeQueryOptionExpression.cs
- ControlUtil.cs
- DataGridAddNewRow.cs
- TypefaceMap.cs
- TagMapCollection.cs
- DbConnectionOptions.cs
- ReadOnlyTernaryTree.cs
- NetDispatcherFaultException.cs
- TableItemProviderWrapper.cs
- HtmlHistory.cs
- SchemaNamespaceManager.cs
- HuffModule.cs
- ConfigXmlSignificantWhitespace.cs
- MultiPropertyDescriptorGridEntry.cs
- DiscreteKeyFrames.cs
- IdentitySection.cs
- PrimitiveXmlSerializers.cs
- SqlNotificationEventArgs.cs
- ControlCachePolicy.cs
- WarningException.cs
- WebFaultClientMessageInspector.cs
- Deflater.cs
- Regex.cs
- DocumentXmlWriter.cs
- XamlInterfaces.cs
- StatusBar.cs
- ToolStripDropDownButton.cs
- UserUseLicenseDictionaryLoader.cs
- ChannelFactory.cs
- SafeNativeMethods.cs
- FileDialog_Vista_Interop.cs
- PropertyEntry.cs
- ProfileService.cs