Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- Clause.cs
- ConfigPathUtility.cs
- cookieexception.cs
- OrthographicCamera.cs
- CodeVariableDeclarationStatement.cs
- BmpBitmapEncoder.cs
- ClientApiGenerator.cs
- XmlFileEditor.cs
- QueryOutputWriter.cs
- SqlCacheDependencyDatabaseCollection.cs
- AppDomainUnloadedException.cs
- ControlUtil.cs
- AbstractExpressions.cs
- CellCreator.cs
- FileVersionInfo.cs
- ArgIterator.cs
- AutomationAttributeInfo.cs
- ExpressionParser.cs
- Operand.cs
- MetadataFile.cs
- Dump.cs
- CultureSpecificStringDictionary.cs
- OleDbParameter.cs
- ADMembershipUser.cs
- ThreadStaticAttribute.cs
- ContextMenuStripGroup.cs
- XmlSchemaAnyAttribute.cs
- OutputWindow.cs
- SymLanguageVendor.cs
- OledbConnectionStringbuilder.cs
- UserValidatedEventArgs.cs
- ConvertersCollection.cs
- ConstrainedGroup.cs
- SqlTypeConverter.cs
- SystemIPAddressInformation.cs
- XPathNodeInfoAtom.cs
- TextParagraphCache.cs
- OpCodes.cs
- DbgCompiler.cs
- NextPreviousPagerField.cs
- TextSelectionProcessor.cs
- OletxVolatileEnlistment.cs
- TTSEngineProxy.cs
- FunctionUpdateCommand.cs
- XmlWrappingReader.cs
- DropShadowBitmapEffect.cs
- TableRowCollection.cs
- GridViewColumnCollectionChangedEventArgs.cs
- ConfigXmlReader.cs
- DeclaredTypeValidatorAttribute.cs
- ConfigurationStrings.cs
- GraphicsPath.cs
- ExpandableObjectConverter.cs
- FtpWebRequest.cs
- StringArrayEditor.cs
- PopupEventArgs.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- ListManagerBindingsCollection.cs
- ControlBindingsCollection.cs
- LOSFormatter.cs
- MapPathBasedVirtualPathProvider.cs
- DockingAttribute.cs
- StoreAnnotationsMap.cs
- SQLUtility.cs
- DataGridCaption.cs
- IncrementalHitTester.cs
- Wizard.cs
- GenericsInstances.cs
- SByte.cs
- ProcessHostServerConfig.cs
- SortedDictionary.cs
- ProviderCommandInfoUtils.cs
- Geometry.cs
- MimeXmlImporter.cs
- TdsParserStateObject.cs
- PageParser.cs
- SeverityFilter.cs
- BrowserTree.cs
- CannotUnloadAppDomainException.cs
- InputLanguageEventArgs.cs
- JoinQueryOperator.cs
- IImplicitResourceProvider.cs
- DataGridViewCell.cs
- FramingChannels.cs
- OdbcEnvironment.cs
- HtmlImage.cs
- SimpleApplicationHost.cs
- FormsIdentity.cs
- ErrorFormatterPage.cs
- MetadataCache.cs
- ShutDownListener.cs
- TextFindEngine.cs
- ApplicationException.cs
- OdbcCommandBuilder.cs
- DataProtection.cs
- input.cs
- SoapMessage.cs
- TypeBrowserDialog.cs
- ProxySimple.cs
- RichTextBox.cs