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
- HttpProfileGroupBase.cs
- TableLayoutPanelDesigner.cs
- ConfigurationPropertyAttribute.cs
- COM2ComponentEditor.cs
- TextDecoration.cs
- AsyncPostBackErrorEventArgs.cs
- OleStrCAMarshaler.cs
- ConditionalAttribute.cs
- ValueTypeFixupInfo.cs
- SecuritySessionServerSettings.cs
- Int16Animation.cs
- Emitter.cs
- Cursor.cs
- CopyCodeAction.cs
- messageonlyhwndwrapper.cs
- CodeExpressionStatement.cs
- Compress.cs
- BuildProvidersCompiler.cs
- UInt32.cs
- RealizationContext.cs
- OdbcErrorCollection.cs
- TemplateAction.cs
- TextHidden.cs
- ELinqQueryState.cs
- RichTextBoxAutomationPeer.cs
- ExpressionEditorAttribute.cs
- SqlAliaser.cs
- XmlMemberMapping.cs
- PolicyStatement.cs
- DiagnosticSection.cs
- PostBackTrigger.cs
- ResourceContainer.cs
- storepermissionattribute.cs
- IMembershipProvider.cs
- UnknownBitmapEncoder.cs
- ScriptRef.cs
- MultiPropertyDescriptorGridEntry.cs
- VectorAnimationUsingKeyFrames.cs
- SqlServer2KCompatibilityAnnotation.cs
- ClientBase.cs
- InvokePatternIdentifiers.cs
- CellParagraph.cs
- SerializerWriterEventHandlers.cs
- DataColumnMappingCollection.cs
- SymbolEqualComparer.cs
- LabelEditEvent.cs
- TypeUsageBuilder.cs
- CssTextWriter.cs
- DataGridViewAdvancedBorderStyle.cs
- DynamicMethod.cs
- SerializationObjectManager.cs
- MemberPathMap.cs
- XmlCountingReader.cs
- NumericUpDownAcceleration.cs
- IPAddress.cs
- WebBaseEventKeyComparer.cs
- Path.cs
- CodeGotoStatement.cs
- StorageTypeMapping.cs
- WindowsToolbar.cs
- XsdDateTime.cs
- BufferedWebEventProvider.cs
- Tuple.cs
- WindowsStatic.cs
- JsonDeserializer.cs
- AnimationTimeline.cs
- HeaderedContentControl.cs
- InputLanguageSource.cs
- Size.cs
- TypeUsage.cs
- WindowsTreeView.cs
- GridViewUpdateEventArgs.cs
- WindowsListViewItem.cs
- DependencyObject.cs
- _NetRes.cs
- GlobalizationSection.cs
- BufferedGraphicsContext.cs
- KeyValueConfigurationCollection.cs
- SecurityTokenRequirement.cs
- TextRange.cs
- DayRenderEvent.cs
- XmlSecureResolver.cs
- SoapIncludeAttribute.cs
- ToolboxComponentsCreatingEventArgs.cs
- CodeNamespace.cs
- QueryTaskGroupState.cs
- WebScriptMetadataMessage.cs
- PasswordRecovery.cs
- CacheDependency.cs
- InputMethod.cs
- SiteMapNodeCollection.cs
- FileSystemInfo.cs
- InstanceContextMode.cs
- XmlSchemaCompilationSettings.cs
- ResourceCodeDomSerializer.cs
- StrongNameMembershipCondition.cs
- StrokeNodeOperations2.cs
- FileLevelControlBuilderAttribute.cs
- ResourcesChangeInfo.cs
- ComboBoxAutomationPeer.cs