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
- SocketPermission.cs
- PixelFormatConverter.cs
- ItemCheckedEvent.cs
- OleDbEnumerator.cs
- SqlClientMetaDataCollectionNames.cs
- PixelShader.cs
- OleDbReferenceCollection.cs
- DeclarativeExpressionConditionDeclaration.cs
- HistoryEventArgs.cs
- ProcessHostConfigUtils.cs
- SoapElementAttribute.cs
- XmlTextWriter.cs
- ActivityCodeDomSerializationManager.cs
- LicenseManager.cs
- WebPageTraceListener.cs
- ToolZone.cs
- ListInitExpression.cs
- QuaternionAnimation.cs
- ByeMessageApril2005.cs
- _NegotiateClient.cs
- FacetDescription.cs
- BoundColumn.cs
- DuplicateWaitObjectException.cs
- LogExtentCollection.cs
- DataGridViewRowHeaderCell.cs
- jithelpers.cs
- DropDownButton.cs
- Variable.cs
- JsonReader.cs
- DelegatingTypeDescriptionProvider.cs
- HttpWebRequestElement.cs
- Rectangle.cs
- XmlElementList.cs
- XmlHierarchyData.cs
- ExportFileRequest.cs
- ToolboxDataAttribute.cs
- PageContent.cs
- SchemaImporterExtensionElement.cs
- ClientScriptManager.cs
- BindingManagerDataErrorEventArgs.cs
- XmlSchemaSimpleContent.cs
- UnmanagedMarshal.cs
- BigInt.cs
- TypefaceMap.cs
- AttachedAnnotation.cs
- InheritanceContextChangedEventManager.cs
- PenLineJoinValidation.cs
- ChtmlLinkAdapter.cs
- FunctionCommandText.cs
- HttpCapabilitiesEvaluator.cs
- FixedElement.cs
- UpdateCommand.cs
- MembershipSection.cs
- ProxyElement.cs
- DesignTimeValidationFeature.cs
- DrawingContextWalker.cs
- FunctionParameter.cs
- ParameterToken.cs
- XmlEntityReference.cs
- SecureConversationSecurityTokenParameters.cs
- Stack.cs
- PointLight.cs
- BlurBitmapEffect.cs
- Win32.cs
- DecoderExceptionFallback.cs
- NoPersistScope.cs
- BindingExpression.cs
- Array.cs
- GraphicsPathIterator.cs
- KerberosSecurityTokenProvider.cs
- HtmlSelect.cs
- SendingRequestEventArgs.cs
- ListBindingConverter.cs
- DataBoundControl.cs
- TargetInvocationException.cs
- XmlSchemaAttributeGroup.cs
- shaper.cs
- SystemResourceKey.cs
- ExpressionBuilderCollection.cs
- ScaleTransform3D.cs
- XPathDocumentNavigator.cs
- DataControlFieldCollection.cs
- TextUtf8RawTextWriter.cs
- AttributeCollection.cs
- LaxModeSecurityHeaderElementInferenceEngine.cs
- ControlHelper.cs
- ResourceDescriptionAttribute.cs
- BackgroundFormatInfo.cs
- ProcessModuleDesigner.cs
- DecimalKeyFrameCollection.cs
- MultipleViewPattern.cs
- DataServiceQueryException.cs
- PackageDigitalSignature.cs
- LabelDesigner.cs
- HitTestFilterBehavior.cs
- CodeArrayCreateExpression.cs
- ProviderException.cs
- WebServiceHost.cs
- TextProperties.cs
- DataGridViewColumnStateChangedEventArgs.cs