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
- NameSpaceEvent.cs
- Models.cs
- ExpressionEvaluator.cs
- PenThreadWorker.cs
- Message.cs
- FrameworkRichTextComposition.cs
- TextChangedEventArgs.cs
- UDPClient.cs
- ObjectItemAssemblyLoader.cs
- DataGridCellAutomationPeer.cs
- ErrorTableItemStyle.cs
- GridViewDeletedEventArgs.cs
- PreviewPageInfo.cs
- WebConfigManager.cs
- Light.cs
- WebDescriptionAttribute.cs
- FormViewPagerRow.cs
- AssemblyAttributesGoHere.cs
- PageAction.cs
- SimpleApplicationHost.cs
- NativeCppClassAttribute.cs
- RecordManager.cs
- EmulateRecognizeCompletedEventArgs.cs
- ScrollViewer.cs
- FlowLayoutPanel.cs
- MenuItemBindingCollection.cs
- ConnectionProviderAttribute.cs
- ElementNotEnabledException.cs
- NotSupportedException.cs
- VectorAnimationUsingKeyFrames.cs
- ColorTransform.cs
- QueryResponse.cs
- DataBindingHandlerAttribute.cs
- IgnoreFileBuildProvider.cs
- TextElementAutomationPeer.cs
- OleDbConnectionInternal.cs
- XmlValidatingReader.cs
- ReadOnlyObservableCollection.cs
- InputLangChangeEvent.cs
- IgnoreSection.cs
- XmlDocumentFieldSchema.cs
- XslException.cs
- SolidColorBrush.cs
- DataTableMapping.cs
- LinqDataSourceView.cs
- Stopwatch.cs
- RepeaterItemCollection.cs
- InheritedPropertyDescriptor.cs
- Int32AnimationBase.cs
- versioninfo.cs
- UTF32Encoding.cs
- SmtpFailedRecipientsException.cs
- HttpRawResponse.cs
- ParameterToken.cs
- InputScopeManager.cs
- Int32Rect.cs
- SoapInteropTypes.cs
- CopyCodeAction.cs
- ServiceBuildProvider.cs
- BamlLocalizabilityResolver.cs
- Marshal.cs
- FilteredAttributeCollection.cs
- Stylus.cs
- Ref.cs
- StylusTip.cs
- OracleConnection.cs
- TextParaClient.cs
- BitmapMetadataEnumerator.cs
- ListSourceHelper.cs
- CodeAccessPermission.cs
- ServiceAuthorizationBehavior.cs
- OdbcInfoMessageEvent.cs
- WhitespaceRule.cs
- RichTextBoxAutomationPeer.cs
- UInt64.cs
- smtpconnection.cs
- Model3D.cs
- Page.cs
- HtmlTableRowCollection.cs
- LogManagementAsyncResult.cs
- TextFormatter.cs
- DataListItemCollection.cs
- SafeProcessHandle.cs
- ProcessHostFactoryHelper.cs
- SettingsSection.cs
- DecoderExceptionFallback.cs
- CheckBoxField.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- TextDecoration.cs
- EndpointDispatcher.cs
- ProtocolsSection.cs
- SqlErrorCollection.cs
- WorkItem.cs
- ListView.cs
- AssemblyHash.cs
- ImageKeyConverter.cs
- HtmlLink.cs
- TemplateControlBuildProvider.cs
- SystemResources.cs
- CompilerTypeWithParams.cs