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
- ProtocolsConfiguration.cs
- Padding.cs
- ReflectEventDescriptor.cs
- DataListComponentEditor.cs
- ChannelListenerBase.cs
- UriSectionReader.cs
- Choices.cs
- ByteRangeDownloader.cs
- RepeaterCommandEventArgs.cs
- HTMLTextWriter.cs
- MergePropertyDescriptor.cs
- BinaryObjectWriter.cs
- Model3DGroup.cs
- DynamicResourceExtensionConverter.cs
- WindowsEditBox.cs
- SmiContext.cs
- SHA384.cs
- ObjectToIdCache.cs
- ResizeGrip.cs
- ConfigurationPermission.cs
- MailHeaderInfo.cs
- GlobalizationSection.cs
- ProtocolsSection.cs
- SchemaType.cs
- CodeBinaryOperatorExpression.cs
- MessageQueuePermissionEntry.cs
- DbConnectionHelper.cs
- CommandEventArgs.cs
- DecimalStorage.cs
- RequestTimeoutManager.cs
- MouseEvent.cs
- ThreadStateException.cs
- RefType.cs
- SqlMetaData.cs
- SendKeys.cs
- ReachVisualSerializer.cs
- TemplateKey.cs
- DynamicHyperLink.cs
- SessionStateContainer.cs
- HashAlgorithm.cs
- DebugHandleTracker.cs
- iisPickupDirectory.cs
- PageSettings.cs
- MessageSmuggler.cs
- QilIterator.cs
- TrackingValidationObjectDictionary.cs
- HtmlInputRadioButton.cs
- SafeLocalAllocation.cs
- basevalidator.cs
- RecognitionEventArgs.cs
- DiagnosticTrace.cs
- AvTrace.cs
- StylusCaptureWithinProperty.cs
- OracleConnection.cs
- SqlException.cs
- WizardDesigner.cs
- CapabilitiesRule.cs
- StringConcat.cs
- FuncTypeConverter.cs
- Vector.cs
- QueryValue.cs
- DllNotFoundException.cs
- XPathArrayIterator.cs
- OrderPreservingMergeHelper.cs
- Matrix3DConverter.cs
- X509CertificateRecipientServiceCredential.cs
- Journaling.cs
- NativeDirectoryServicesQueryAPIs.cs
- Application.cs
- DNS.cs
- CommentEmitter.cs
- SqlBinder.cs
- Int32CAMarshaler.cs
- ToolStripMenuItem.cs
- Animatable.cs
- TextAction.cs
- ServiceMemoryGates.cs
- DynamicValidator.cs
- XmlNavigatorStack.cs
- TypeGeneratedEventArgs.cs
- TextSearch.cs
- Delegate.cs
- CqlParserHelpers.cs
- DataColumnCollection.cs
- Vector.cs
- UnionQueryOperator.cs
- SqlServer2KCompatibilityAnnotation.cs
- ForwardPositionQuery.cs
- StateItem.cs
- DataReaderContainer.cs
- HasCopySemanticsAttribute.cs
- WhileDesigner.xaml.cs
- Maps.cs
- Events.cs
- ContainerParagraph.cs
- GridViewColumnCollectionChangedEventArgs.cs
- InputGestureCollection.cs
- XPathPatternBuilder.cs
- initElementDictionary.cs
- XhtmlBasicPhoneCallAdapter.cs