Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- DbDataSourceEnumerator.cs
- EncryptedData.cs
- LocatorManager.cs
- WindowsHyperlink.cs
- AspCompat.cs
- TableLayoutSettings.cs
- WebUtil.cs
- DefaultProxySection.cs
- CryptoApi.cs
- _NestedMultipleAsyncResult.cs
- XsdCachingReader.cs
- XmlSequenceWriter.cs
- PerspectiveCamera.cs
- RelatedView.cs
- StretchValidation.cs
- DbReferenceCollection.cs
- InputLanguage.cs
- ExtensibleClassFactory.cs
- MarkerProperties.cs
- PrincipalPermission.cs
- MetadataCacheItem.cs
- Tracking.cs
- ForEachAction.cs
- XmlSubtreeReader.cs
- ServiceManagerHandle.cs
- WebPartChrome.cs
- ExpressionLexer.cs
- BindingList.cs
- documentsequencetextview.cs
- DataGridViewControlCollection.cs
- ContentIterators.cs
- PropertyEmitter.cs
- MultiView.cs
- ProtectedUri.cs
- ApplicationException.cs
- TCPListener.cs
- DefaultObjectMappingItemCollection.cs
- DataGridClipboardHelper.cs
- Int16KeyFrameCollection.cs
- Flattener.cs
- ImageButton.cs
- DataException.cs
- DigitalSignatureProvider.cs
- AutomationElementCollection.cs
- AlignmentXValidation.cs
- DesignerTransactionCloseEvent.cs
- _Win32.cs
- Classification.cs
- BypassElement.cs
- SqlCrossApplyToCrossJoin.cs
- XmlSecureResolver.cs
- DeploymentSectionCache.cs
- IResourceProvider.cs
- Pen.cs
- NetworkInformationPermission.cs
- Utility.cs
- TemplateParser.cs
- NumberFormatter.cs
- CompositeFontFamily.cs
- RelationshipConverter.cs
- DependencyObjectProvider.cs
- FlowDocumentPaginator.cs
- TextBoxAutoCompleteSourceConverter.cs
- GeneralTransform3DTo2DTo3D.cs
- ExpressionBinding.cs
- TemplateApplicationHelper.cs
- MarkedHighlightComponent.cs
- PointLight.cs
- MessageLogTraceRecord.cs
- ReversePositionQuery.cs
- ReadOnlyDataSourceView.cs
- MachineKeyConverter.cs
- SocketElement.cs
- SetStateEventArgs.cs
- XmlnsDictionary.cs
- WebBrowserProgressChangedEventHandler.cs
- RtfToXamlReader.cs
- IndexerNameAttribute.cs
- ListView.cs
- DataRecordInternal.cs
- CatalogZoneAutoFormat.cs
- StorageEndPropertyMapping.cs
- Guid.cs
- InvalidProgramException.cs
- ColorConvertedBitmap.cs
- LogArchiveSnapshot.cs
- LineServicesRun.cs
- FamilyCollection.cs
- BuiltInPermissionSets.cs
- InputLanguage.cs
- TemplateXamlTreeBuilder.cs
- M3DUtil.cs
- MILUtilities.cs
- RSACryptoServiceProvider.cs
- SecureStringHasher.cs
- LinearQuaternionKeyFrame.cs
- AssociationSetMetadata.cs
- DummyDataSource.cs
- WindowsTab.cs
- InfoCardSymmetricCrypto.cs