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
- CmsInterop.cs
- selecteditemcollection.cs
- COM2ExtendedUITypeEditor.cs
- BamlResourceSerializer.cs
- ValidateNames.cs
- PreservationFileWriter.cs
- BCLDebug.cs
- ReaderContextStackData.cs
- GridViewItemAutomationPeer.cs
- LinkLabelLinkClickedEvent.cs
- JoinGraph.cs
- DBSchemaRow.cs
- ApplicationGesture.cs
- AttributeConverter.cs
- PartitionResolver.cs
- SafeRightsManagementPubHandle.cs
- GroupItemAutomationPeer.cs
- ContainerParaClient.cs
- XmlComment.cs
- ReadOnlyDataSourceView.cs
- CallContext.cs
- PreloadedPackages.cs
- MethodBuilderInstantiation.cs
- ZipIOExtraFieldPaddingElement.cs
- TextFindEngine.cs
- FeatureSupport.cs
- SizeFConverter.cs
- WindowsStartMenu.cs
- CLSCompliantAttribute.cs
- HtmlTextArea.cs
- ToolStripDropDownItemDesigner.cs
- Gdiplus.cs
- _Events.cs
- Margins.cs
- FixUp.cs
- HelpFileFileNameEditor.cs
- XmlDocumentType.cs
- XmlDocumentType.cs
- CornerRadiusConverter.cs
- DecoderNLS.cs
- _ListenerRequestStream.cs
- ReflectEventDescriptor.cs
- NamespaceCollection.cs
- DataGridViewHitTestInfo.cs
- TypeConverterHelper.cs
- SystemFonts.cs
- ImageInfo.cs
- CodePageEncoding.cs
- CharacterBufferReference.cs
- DoubleStorage.cs
- StructuredProperty.cs
- XmlComment.cs
- IPipelineRuntime.cs
- UserNameSecurityToken.cs
- FamilyTypefaceCollection.cs
- DataListItemEventArgs.cs
- MembershipSection.cs
- VectorCollection.cs
- TypeBinaryExpression.cs
- TextParagraphCache.cs
- ConstrainedDataObject.cs
- sitestring.cs
- SoapIgnoreAttribute.cs
- XamlPointCollectionSerializer.cs
- ChannelBuilder.cs
- PermissionListSet.cs
- NumberSubstitution.cs
- ContextStack.cs
- AssemblyName.cs
- SecurityHeader.cs
- BindingValueChangedEventArgs.cs
- ScaleTransform3D.cs
- CounterSampleCalculator.cs
- SolidColorBrush.cs
- SecurityContextTokenValidationException.cs
- ConfigurationSectionCollection.cs
- UpdatePanel.cs
- PagesSection.cs
- FloatAverageAggregationOperator.cs
- MenuRendererStandards.cs
- PseudoWebRequest.cs
- FunctionImportElement.cs
- ArrayList.cs
- PointAnimationClockResource.cs
- storepermissionattribute.cs
- ObjRef.cs
- ActivityBuilder.cs
- AsmxEndpointPickerExtension.cs
- SqlCacheDependencyDatabase.cs
- XhtmlStyleClass.cs
- LineSegment.cs
- TextElementCollection.cs
- CatalogZoneBase.cs
- ConfigurationElementCollection.cs
- AnimationStorage.cs
- WindowsIdentity.cs
- CodeBlockBuilder.cs
- ViewStateException.cs
- DataGridColumnStyleMappingNameEditor.cs
- MULTI_QI.cs