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
- EmbeddedMailObject.cs
- KerberosTicketHashIdentifierClause.cs
- WebHttpEndpoint.cs
- DocumentSchemaValidator.cs
- XmlDocumentSerializer.cs
- StyleXamlParser.cs
- Size.cs
- _UncName.cs
- ParagraphVisual.cs
- EntryPointNotFoundException.cs
- HttpVersion.cs
- XmlMemberMapping.cs
- ItemsControl.cs
- WebPartVerbsEventArgs.cs
- PriorityQueue.cs
- AutomationElementCollection.cs
- GeometryGroup.cs
- ClientSettingsSection.cs
- ItemsPanelTemplate.cs
- CommentEmitter.cs
- SimplePropertyEntry.cs
- JapaneseLunisolarCalendar.cs
- ParameterCollection.cs
- SpotLight.cs
- HttpHandlerActionCollection.cs
- WmpBitmapDecoder.cs
- UserControlBuildProvider.cs
- EndpointDesigner.cs
- TableLayoutPanelCellPosition.cs
- XmlSchemas.cs
- ManagedIStream.cs
- ItemCollection.cs
- Pipe.cs
- DefaultParameterValueAttribute.cs
- Compress.cs
- Trace.cs
- FatalException.cs
- DownloadProgressEventArgs.cs
- FileVersionInfo.cs
- ApplicationServiceManager.cs
- PeerNearMe.cs
- SignedXmlDebugLog.cs
- ModuleElement.cs
- BaseInfoTable.cs
- ItemCollection.cs
- ExtentKey.cs
- EntityUtil.cs
- InternalBufferOverflowException.cs
- IDQuery.cs
- Border.cs
- ProfessionalColors.cs
- DataServiceRequest.cs
- ClientApiGenerator.cs
- LayoutEditorPart.cs
- FlatButtonAppearance.cs
- OdbcRowUpdatingEvent.cs
- FunctionDescription.cs
- TextSpan.cs
- ExpressionBuilderContext.cs
- SqlClientWrapperSmiStream.cs
- UserControlParser.cs
- DrawingAttributesDefaultValueFactory.cs
- PhysicalAddress.cs
- Exceptions.cs
- PageAction.cs
- LineUtil.cs
- WebPartConnectionsCloseVerb.cs
- IgnoreSection.cs
- ExpressionDumper.cs
- UrlMappingsSection.cs
- ClientSession.cs
- ContentValidator.cs
- XhtmlTextWriter.cs
- DataGridViewCellPaintingEventArgs.cs
- XMLUtil.cs
- StateItem.cs
- PropertyValueUIItem.cs
- VisualStyleTypesAndProperties.cs
- SqlDataSourceConnectionPanel.cs
- WorkBatch.cs
- Triangle.cs
- XamlValidatingReader.cs
- BitmapMetadataEnumerator.cs
- WebPartConnection.cs
- TextMetrics.cs
- EntityObject.cs
- SerializerDescriptor.cs
- XsdValidatingReader.cs
- _Semaphore.cs
- RuleProcessor.cs
- SelectionService.cs
- SpeechUI.cs
- StoryFragments.cs
- ComPersistableTypeElement.cs
- AlgoModule.cs
- EntityStoreSchemaGenerator.cs
- DrawingVisualDrawingContext.cs
- IsolatedStoragePermission.cs
- QualificationDataItem.cs
- LinearQuaternionKeyFrame.cs