Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- QueryConverter.cs
- Timer.cs
- IdentityReference.cs
- HtmlAnchor.cs
- Misc.cs
- TreeNodeClickEventArgs.cs
- ExpressionWriter.cs
- ExtractorMetadata.cs
- FixedSOMLineCollection.cs
- CachingHintValidation.cs
- HitTestParameters3D.cs
- PackagingUtilities.cs
- HelpEvent.cs
- ObjectComplexPropertyMapping.cs
- BitmapEffectGroup.cs
- AudioFormatConverter.cs
- SqlIdentifier.cs
- Intellisense.cs
- Util.cs
- WebConfigurationFileMap.cs
- CodeDefaultValueExpression.cs
- XmlSchemaSimpleTypeList.cs
- ChooseAction.cs
- ConvertersCollection.cs
- ReadOnlyDictionary.cs
- HTMLTextWriter.cs
- AmbientProperties.cs
- SAPIEngineTypes.cs
- CodeRegionDirective.cs
- RegexWorker.cs
- Panel.cs
- WebControlParameterProxy.cs
- DataGridViewRowHeaderCell.cs
- ObsoleteAttribute.cs
- LinkButton.cs
- XsltCompileContext.cs
- ListItemCollection.cs
- WindowsFormsHostAutomationPeer.cs
- AssociationType.cs
- SystemTcpStatistics.cs
- BaseCodePageEncoding.cs
- ToolboxItemAttribute.cs
- RootBrowserWindowProxy.cs
- ToggleButtonAutomationPeer.cs
- Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
- FixedSchema.cs
- RewritingSimplifier.cs
- SchemaElementLookUpTableEnumerator.cs
- entityreference_tresulttype.cs
- SortExpressionBuilder.cs
- WindowsListViewGroup.cs
- ArraySubsetEnumerator.cs
- ViewValidator.cs
- ImageAttributes.cs
- Permission.cs
- ClickablePoint.cs
- RemotingConfiguration.cs
- TransactionInterop.cs
- IPAddress.cs
- SaveFileDialog.cs
- _AutoWebProxyScriptWrapper.cs
- QilBinary.cs
- RegisteredScript.cs
- MemberProjectedSlot.cs
- TraceUtility.cs
- EllipseGeometry.cs
- Vector3DAnimationUsingKeyFrames.cs
- ModelProperty.cs
- PlainXmlDeserializer.cs
- WebEventTraceProvider.cs
- ConfigXmlSignificantWhitespace.cs
- OdbcParameter.cs
- DesignTimeHTMLTextWriter.cs
- StackBuilderSink.cs
- SecurityIdentifierElementCollection.cs
- SqlCacheDependencyDatabaseCollection.cs
- DelimitedListTraceListener.cs
- AddInPipelineAttributes.cs
- TextEditorDragDrop.cs
- GenericRootAutomationPeer.cs
- CompoundFileReference.cs
- _OSSOCK.cs
- FormParameter.cs
- Utils.cs
- RecognizerBase.cs
- SafeHandles.cs
- SystemIPGlobalProperties.cs
- BoundPropertyEntry.cs
- ILGenerator.cs
- EnumBuilder.cs
- ToolTipAutomationPeer.cs
- CheckBoxStandardAdapter.cs
- WebServiceErrorEvent.cs
- PluggableProtocol.cs
- RequestCacheManager.cs
- NetworkInformationException.cs
- WindowsIPAddress.cs
- XPathNodePointer.cs
- XPathNodeIterator.cs
- HtmlSelect.cs