Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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);
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Array.cs
- GridViewHeaderRowPresenter.cs
- CallId.cs
- PropertyInformationCollection.cs
- TagMapInfo.cs
- DataGridViewRowCancelEventArgs.cs
- _CookieModule.cs
- InternalTypeHelper.cs
- RsaElement.cs
- ResponseStream.cs
- PlatformNotSupportedException.cs
- AspNetSynchronizationContext.cs
- Line.cs
- UxThemeWrapper.cs
- KeyValueInternalCollection.cs
- GetPageCompletedEventArgs.cs
- WebPartConnectVerb.cs
- XmlHierarchicalEnumerable.cs
- GeneralTransform3DTo2D.cs
- ProxyWebPartConnectionCollection.cs
- ToolStripItemBehavior.cs
- documentation.cs
- MatrixValueSerializer.cs
- ConstructorBuilder.cs
- ElementHostAutomationPeer.cs
- FileDialog_Vista_Interop.cs
- Pointer.cs
- EventKeyword.cs
- TraceSection.cs
- MenuItemStyle.cs
- HttpRequest.cs
- CheckoutException.cs
- PeerEndPoint.cs
- EntitySqlQueryCacheEntry.cs
- ToolStripItemImageRenderEventArgs.cs
- RouteParametersHelper.cs
- ClientTargetCollection.cs
- CalendarTable.cs
- KeySplineConverter.cs
- EndEvent.cs
- RegexCaptureCollection.cs
- WorkflowViewElement.cs
- PresentationTraceSources.cs
- ListBindingHelper.cs
- SizeValueSerializer.cs
- HttpModuleAction.cs
- WebPartConnectVerb.cs
- ThicknessAnimation.cs
- Semaphore.cs
- DefaultBindingPropertyAttribute.cs
- RepeaterItemEventArgs.cs
- HashMembershipCondition.cs
- MD5CryptoServiceProvider.cs
- SqlInternalConnectionTds.cs
- WebPartZoneBase.cs
- TabItemAutomationPeer.cs
- AddToCollection.cs
- Serializer.cs
- Int16Storage.cs
- BitmapCodecInfo.cs
- HttpClientCertificate.cs
- TypedTableBaseExtensions.cs
- GlyphTypeface.cs
- Rectangle.cs
- QilPatternFactory.cs
- BaseCodeDomTreeGenerator.cs
- RetrieveVirtualItemEventArgs.cs
- ToolStripDropDownClosedEventArgs.cs
- UTF7Encoding.cs
- BindingRestrictions.cs
- DefaultEvaluationContext.cs
- Int32RectConverter.cs
- HebrewCalendar.cs
- GridViewEditEventArgs.cs
- TableRowCollection.cs
- NamespaceMapping.cs
- Rect.cs
- StringArrayConverter.cs
- SmiContext.cs
- KoreanLunisolarCalendar.cs
- HttpModulesSection.cs
- SiteIdentityPermission.cs
- Annotation.cs
- InternalBufferManager.cs
- StandardToolWindows.cs
- DateTimeParse.cs
- xdrvalidator.cs
- Size.cs
- DataGridViewToolTip.cs
- TextAnchor.cs
- SocketException.cs
- RoutedEventValueSerializer.cs
- QuadraticBezierSegment.cs
- Label.cs
- DataListCommandEventArgs.cs
- Color.cs
- HttpModulesSection.cs
- HttpModuleActionCollection.cs
- XmlLanguageConverter.cs
- TextTrailingWordEllipsis.cs