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
- DataGridViewComboBoxEditingControl.cs
- SecurityAttributeGenerationHelper.cs
- FrameworkContentElement.cs
- BaseCodeDomTreeGenerator.cs
- Misc.cs
- metadatamappinghashervisitor.cs
- SQLChars.cs
- ValidationResult.cs
- EllipseGeometry.cs
- StandardToolWindows.cs
- Listbox.cs
- XmlWrappingReader.cs
- RestHandlerFactory.cs
- StringComparer.cs
- UserNamePasswordClientCredential.cs
- DATA_BLOB.cs
- EntityDataSourceEntityTypeFilterItem.cs
- SubordinateTransaction.cs
- DesignerCategoryAttribute.cs
- BreakRecordTable.cs
- metadatamappinghashervisitor.cs
- CodeAttributeArgumentCollection.cs
- Single.cs
- Variant.cs
- DataServiceResponse.cs
- Label.cs
- BamlMapTable.cs
- FileVersionInfo.cs
- VoiceChangeEventArgs.cs
- ConnectionPoolManager.cs
- SchemaObjectWriter.cs
- CellQuery.cs
- DeclarationUpdate.cs
- ContractAdapter.cs
- UrlMapping.cs
- ToolStripSeparatorRenderEventArgs.cs
- WpfKnownTypeInvoker.cs
- CodeAttributeArgument.cs
- DebugView.cs
- SRGSCompiler.cs
- tabpagecollectioneditor.cs
- OdbcConnectionFactory.cs
- Matrix3D.cs
- ContentOperations.cs
- SafeNativeMethods.cs
- WebPartEditorApplyVerb.cs
- EntityObject.cs
- ResourceReferenceExpression.cs
- Guid.cs
- HttpListenerContext.cs
- RequestCachingSection.cs
- TableItemProviderWrapper.cs
- SqlRetyper.cs
- BufferedReadStream.cs
- ContentDisposition.cs
- DirectionalLight.cs
- BufferedGraphicsManager.cs
- ContentPropertyAttribute.cs
- Point3DAnimationBase.cs
- ParallelEnumerable.cs
- EventLogStatus.cs
- EventItfInfo.cs
- HandlerWithFactory.cs
- ISCIIEncoding.cs
- PreservationFileReader.cs
- GridViewEditEventArgs.cs
- WithStatement.cs
- ToolboxItemAttribute.cs
- FieldNameLookup.cs
- ScopedKnownTypes.cs
- WebHttpEndpointElement.cs
- CookieParameter.cs
- NavigationCommands.cs
- SrgsRuleRef.cs
- WindowsImpersonationContext.cs
- Cursor.cs
- LicFileLicenseProvider.cs
- FolderBrowserDialog.cs
- SoapAttributes.cs
- SerializationEventsCache.cs
- RequestCachingSection.cs
- assemblycache.cs
- TextFormatterContext.cs
- VisualBasicDesignerHelper.cs
- sitestring.cs
- XsltInput.cs
- SiteMapNode.cs
- DataObjectPastingEventArgs.cs
- UpdateProgress.cs
- XmlIncludeAttribute.cs
- NavigationEventArgs.cs
- XmlCharCheckingWriter.cs
- RenamedEventArgs.cs
- EndEvent.cs
- PopupRoot.cs
- XmlNotation.cs
- FormatterConverter.cs
- WorkflowEnvironment.cs
- TableLayout.cs
- PointCollectionConverter.cs