Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / clr / src / BCL / System / Security / Cryptography / HMACSHA1.cs / 1 / HMACSHA1.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
//
// HMACSHA1.cs
//
namespace System.Security.Cryptography {
[System.Runtime.InteropServices.ComVisible(true)]
public class HMACSHA1 : HMAC {
//
// public constructors
//
public HMACSHA1 () : this (Utils.GenerateRandom(64)) {}
public HMACSHA1 (byte[] key) : this (key, false) {}
public HMACSHA1 (byte[] key, bool useManagedSha1) {
m_hashName = "SHA1";
if (useManagedSha1) {
m_hash1 = new SHA1Managed();
m_hash2 = new SHA1Managed();
} else {
m_hash1 = new SHA1CryptoServiceProvider();
m_hash2 = new SHA1CryptoServiceProvider();
}
HashSizeValue = 160;
base.InitializeKey(key);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
//
// HMACSHA1.cs
//
namespace System.Security.Cryptography {
[System.Runtime.InteropServices.ComVisible(true)]
public class HMACSHA1 : HMAC {
//
// public constructors
//
public HMACSHA1 () : this (Utils.GenerateRandom(64)) {}
public HMACSHA1 (byte[] key) : this (key, false) {}
public HMACSHA1 (byte[] key, bool useManagedSha1) {
m_hashName = "SHA1";
if (useManagedSha1) {
m_hash1 = new SHA1Managed();
m_hash2 = new SHA1Managed();
} else {
m_hash1 = new SHA1CryptoServiceProvider();
m_hash2 = new SHA1CryptoServiceProvider();
}
HashSizeValue = 160;
base.InitializeKey(key);
}
}
}
// 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
- FrameSecurityDescriptor.cs
- Decimal.cs
- SmiSettersStream.cs
- DetailsViewInsertEventArgs.cs
- PropertyPushdownHelper.cs
- DataServiceQueryOfT.cs
- SqlDataSourceEnumerator.cs
- XmlIlGenerator.cs
- TdsRecordBufferSetter.cs
- XsltQilFactory.cs
- DnsPermission.cs
- DiagnosticTraceRecords.cs
- Publisher.cs
- MasterPageBuildProvider.cs
- BindingListCollectionView.cs
- HeaderUtility.cs
- ScriptManager.cs
- ScrollBar.cs
- TimeZoneInfo.cs
- HttpProfileGroupBase.cs
- DefaultBindingPropertyAttribute.cs
- Span.cs
- WebPartManagerInternals.cs
- TextEndOfParagraph.cs
- IResourceProvider.cs
- DaylightTime.cs
- XsdCachingReader.cs
- AmbiguousMatchException.cs
- DataBindingExpressionBuilder.cs
- DesignerRegion.cs
- EventListener.cs
- Stroke.cs
- BuiltInExpr.cs
- XPathDocument.cs
- FileClassifier.cs
- EventEntry.cs
- XamlTypeWithExplicitNamespace.cs
- storagemappingitemcollection.viewdictionary.cs
- _SingleItemRequestCache.cs
- RelationshipFixer.cs
- ConfigXmlElement.cs
- Transform.cs
- ErrorFormatterPage.cs
- SymmetricKey.cs
- NamespaceCollection.cs
- StandardMenuStripVerb.cs
- WS2007HttpBinding.cs
- NavigationWindow.cs
- FileUtil.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- MethodMessage.cs
- CaseCqlBlock.cs
- SmtpDateTime.cs
- Slider.cs
- MachineKeyConverter.cs
- ListViewInsertEventArgs.cs
- Int32.cs
- ClusterSafeNativeMethods.cs
- XPathItem.cs
- Baml6Assembly.cs
- ReachObjectContext.cs
- DeflateStream.cs
- ClientScriptItemCollection.cs
- ProcessModule.cs
- FixedBufferAttribute.cs
- ListBoxItemWrapperAutomationPeer.cs
- XmlWriterTraceListener.cs
- Sql8ExpressionRewriter.cs
- ProxyDataContractResolver.cs
- Calendar.cs
- DragEventArgs.cs
- DecoderNLS.cs
- TypeBinaryExpression.cs
- BackgroundFormatInfo.cs
- ProfileSettingsCollection.cs
- ToolStripButton.cs
- ArgumentException.cs
- PropertyIDSet.cs
- FilteredDataSetHelper.cs
- PagedDataSource.cs
- SingleAnimationBase.cs
- InlineUIContainer.cs
- ActivityExecutionFilter.cs
- TreeViewBindingsEditorForm.cs
- AnnotationResourceChangedEventArgs.cs
- DataMemberConverter.cs
- Buffer.cs
- SchemaElementDecl.cs
- TextBox.cs
- TdsEnums.cs
- AttachedAnnotationChangedEventArgs.cs
- LOSFormatter.cs
- HtmlControl.cs
- ServiceReference.cs
- CreatingCookieEventArgs.cs
- TimeSpanValidator.cs
- WeakReadOnlyCollection.cs
- WebConfigurationManager.cs
- EntityDataSourceView.cs
- RegexBoyerMoore.cs