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
- SamlSerializer.cs
- GridViewEditEventArgs.cs
- CompletionBookmark.cs
- WebPartManagerInternals.cs
- StaticResourceExtension.cs
- GridViewCancelEditEventArgs.cs
- FunctionImportMapping.cs
- SecureUICommand.cs
- Normalizer.cs
- DynamicResourceExtensionConverter.cs
- TypeUtil.cs
- ControlTemplate.cs
- OpCodes.cs
- Attributes.cs
- GB18030Encoding.cs
- SerializationInfoEnumerator.cs
- SizeF.cs
- Select.cs
- FileRecordSequenceCompletedAsyncResult.cs
- ListViewSortEventArgs.cs
- Line.cs
- PropertyNames.cs
- DoneReceivingAsyncResult.cs
- StorageMappingFragment.cs
- EpmCustomContentDeSerializer.cs
- PerformanceCounterNameAttribute.cs
- MenuRendererClassic.cs
- TableRowCollection.cs
- GuidelineCollection.cs
- WebBrowsableAttribute.cs
- AttachmentService.cs
- StoreContentChangedEventArgs.cs
- LinkTarget.cs
- FlatButtonAppearance.cs
- PolicyLevel.cs
- ThemeInfoAttribute.cs
- WebPartMinimizeVerb.cs
- ObjectListCommand.cs
- QuaternionAnimation.cs
- SynchronizedInputHelper.cs
- GatewayDefinition.cs
- XmlSchemaSimpleContent.cs
- TextDecorationUnitValidation.cs
- XPathSingletonIterator.cs
- _NTAuthentication.cs
- FigureParagraph.cs
- Vector3DCollection.cs
- categoryentry.cs
- BooleanExpr.cs
- PersistenceTypeAttribute.cs
- CSharpCodeProvider.cs
- ServiceRoute.cs
- PersonalizationProviderHelper.cs
- DbConnectionClosed.cs
- XmlArrayAttribute.cs
- UnauthorizedAccessException.cs
- LinqDataSourceSelectEventArgs.cs
- _NetRes.cs
- ElementFactory.cs
- altserialization.cs
- TempEnvironment.cs
- GlyphTypeface.cs
- UrlPath.cs
- CollaborationHelperFunctions.cs
- ProfessionalColors.cs
- OdbcRowUpdatingEvent.cs
- ControlBuilder.cs
- EntityContainerRelationshipSet.cs
- Config.cs
- Win32Native.cs
- QueryUtil.cs
- XmlKeywords.cs
- LineMetrics.cs
- Profiler.cs
- NumberSubstitution.cs
- CryptoProvider.cs
- StyleSheetComponentEditor.cs
- CreateUserWizard.cs
- WpfXamlMember.cs
- MSAAEventDispatcher.cs
- RuleInfoComparer.cs
- Rules.cs
- _SslState.cs
- CacheOutputQuery.cs
- CultureTableRecord.cs
- CollectionViewProxy.cs
- SchemaNamespaceManager.cs
- HtmlTextBoxAdapter.cs
- HtmlInputSubmit.cs
- ToolTipService.cs
- SelectionService.cs
- SqlClientWrapperSmiStream.cs
- SerializationFieldInfo.cs
- dtdvalidator.cs
- MenuItemBindingCollection.cs
- AnnotationAuthorChangedEventArgs.cs
- XmlAttributeOverrides.cs
- HwndProxyElementProvider.cs
- InvocationExpression.cs
- ToolStrip.cs