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
- Trigger.cs
- ControlCachePolicy.cs
- RadioButton.cs
- ReferenceSchema.cs
- XmlAttributeOverrides.cs
- CryptoApi.cs
- MouseGestureConverter.cs
- Matrix.cs
- AnnotationComponentManager.cs
- ClientSettings.cs
- CodeAttachEventStatement.cs
- BinaryOperationBinder.cs
- URLString.cs
- RadioButtonFlatAdapter.cs
- DefaultValueAttribute.cs
- LostFocusEventManager.cs
- HTTPRemotingHandler.cs
- MediaSystem.cs
- CalendarDataBindingHandler.cs
- SafeFileMappingHandle.cs
- XmlSchemaSimpleTypeUnion.cs
- WSMessageEncoding.cs
- Vector.cs
- ReceiveErrorHandling.cs
- CollectionBase.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- Form.cs
- ToolboxComponentsCreatingEventArgs.cs
- VisualProxy.cs
- MarkupObject.cs
- Vector3DAnimationUsingKeyFrames.cs
- WebPartMenu.cs
- CodeTypeReferenceCollection.cs
- LoginUtil.cs
- HttpFileCollectionWrapper.cs
- CompilerGeneratedAttribute.cs
- FileDetails.cs
- ModelTreeEnumerator.cs
- DesignerActionMethodItem.cs
- ConfigurationSchemaErrors.cs
- ViewGenResults.cs
- ComponentChangingEvent.cs
- HttpBindingExtension.cs
- Config.cs
- CodeDirectiveCollection.cs
- MappingItemCollection.cs
- ApplicationManager.cs
- CommandBindingCollection.cs
- HighlightVisual.cs
- IdentitySection.cs
- XamlReaderHelper.cs
- RadioButtonBaseAdapter.cs
- SqlDataSource.cs
- SelectionPattern.cs
- PageCodeDomTreeGenerator.cs
- ValueProviderWrapper.cs
- Label.cs
- MatrixValueSerializer.cs
- AxHost.cs
- BamlStream.cs
- RbTree.cs
- CodeAttributeDeclaration.cs
- HandlerMappingMemo.cs
- BindingCollectionElement.cs
- ResourceReferenceExpression.cs
- ThrowHelper.cs
- WebBrowserDocumentCompletedEventHandler.cs
- BinaryUtilClasses.cs
- XmlSchemaFacet.cs
- HashHelper.cs
- PlatformNotSupportedException.cs
- XmlUtilWriter.cs
- SocketManager.cs
- FontUnitConverter.cs
- StorageEntityContainerMapping.cs
- XmlSchemaElement.cs
- SimpleTypeResolver.cs
- AspNetRouteServiceHttpHandler.cs
- GenericEnumConverter.cs
- Transform3DGroup.cs
- RestHandler.cs
- CompensableActivity.cs
- DateRangeEvent.cs
- ByteAnimationBase.cs
- MetadataArtifactLoaderFile.cs
- PointCollection.cs
- SqlDataRecord.cs
- DynamicILGenerator.cs
- BCLDebug.cs
- PageCodeDomTreeGenerator.cs
- VideoDrawing.cs
- ReadOnlyHierarchicalDataSourceView.cs
- ScrollBarAutomationPeer.cs
- SR.cs
- HyperLinkStyle.cs
- XmlMemberMapping.cs
- GeneralTransform2DTo3D.cs
- DataGridToolTip.cs
- EventLogInternal.cs
- WebResourceAttribute.cs