Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- Memoizer.cs
- BaseTemplateCodeDomTreeGenerator.cs
- CaseInsensitiveComparer.cs
- ReferenceService.cs
- HandlerFactoryWrapper.cs
- RelatedImageListAttribute.cs
- SqlTopReducer.cs
- DeferredSelectedIndexReference.cs
- ProvidePropertyAttribute.cs
- CodeCatchClause.cs
- CachingHintValidation.cs
- ByteStream.cs
- KeyPullup.cs
- NegatedCellConstant.cs
- StaticSiteMapProvider.cs
- WinCategoryAttribute.cs
- TargetParameterCountException.cs
- SqlMetaData.cs
- ImageList.cs
- DbTypeMap.cs
- HeaderCollection.cs
- CompressionTransform.cs
- BamlLocalizabilityResolver.cs
- ButtonBase.cs
- Label.cs
- ChineseLunisolarCalendar.cs
- StrokeDescriptor.cs
- XmlAtomicValue.cs
- CheckBox.cs
- ExpressionNode.cs
- MsmqIntegrationSecurity.cs
- HtmlTitle.cs
- RegexGroupCollection.cs
- RuntimeIdentifierPropertyAttribute.cs
- ToolStripDropDownItem.cs
- BitmapEffectDrawingContent.cs
- BaseResourcesBuildProvider.cs
- Odbc32.cs
- TreeViewBindingsEditor.cs
- StorageEntitySetMapping.cs
- InternalControlCollection.cs
- DataViewManagerListItemTypeDescriptor.cs
- ThreadExceptionDialog.cs
- MenuItemStyleCollectionEditor.cs
- SerTrace.cs
- Hashtable.cs
- EmptyImpersonationContext.cs
- CaretElement.cs
- SchemaRegistration.cs
- ImportDesigner.xaml.cs
- AvtEvent.cs
- DrawListViewItemEventArgs.cs
- MetadataExchangeBindings.cs
- ZipIOExtraFieldElement.cs
- StyleModeStack.cs
- XPathNodeIterator.cs
- QueueException.cs
- EnvelopedPkcs7.cs
- ImpersonateTokenRef.cs
- Freezable.cs
- GlobalizationSection.cs
- EditorZoneBase.cs
- AmbientValueAttribute.cs
- XPathParser.cs
- TextEditorTables.cs
- SetStateDesigner.cs
- MarginsConverter.cs
- serverconfig.cs
- FamilyMapCollection.cs
- ToolStripContentPanel.cs
- filewebresponse.cs
- XPathCompileException.cs
- DocumentPage.cs
- ProcessStartInfo.cs
- ExternalException.cs
- EdgeModeValidation.cs
- CfgParser.cs
- CompatibleIComparer.cs
- TlsSspiNegotiation.cs
- EmptyQuery.cs
- DataPagerFieldItem.cs
- DataObjectCopyingEventArgs.cs
- DataGridViewColumnDesigner.cs
- PersonalizablePropertyEntry.cs
- ToolStripItemTextRenderEventArgs.cs
- ContextStaticAttribute.cs
- XmlCharCheckingWriter.cs
- KeyValueConfigurationElement.cs
- ComplexObject.cs
- SafeNativeMethods.cs
- TypeForwardedFromAttribute.cs
- __Error.cs
- Message.cs
- VectorValueSerializer.cs
- TypeExtensionSerializer.cs
- PathGeometry.cs
- EndCreateSecurityTokenRequest.cs
- AdornerPresentationContext.cs
- UntrustedRecipientException.cs
- AvTrace.cs