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
- SqlMethodAttribute.cs
- InkCanvasSelectionAdorner.cs
- NumberFunctions.cs
- SqlParameterizer.cs
- ResourceExpressionBuilder.cs
- InvokeProviderWrapper.cs
- linebase.cs
- ControlTemplate.cs
- ProcessInputEventArgs.cs
- ALinqExpressionVisitor.cs
- XmlDocumentSerializer.cs
- OleStrCAMarshaler.cs
- StylusSystemGestureEventArgs.cs
- XPathParser.cs
- _ScatterGatherBuffers.cs
- _ContextAwareResult.cs
- PropertyValueChangedEvent.cs
- XmlBoundElement.cs
- CommonProperties.cs
- Merger.cs
- DefaultPropertyAttribute.cs
- MessageDescription.cs
- RSAOAEPKeyExchangeDeformatter.cs
- thaishape.cs
- MD5HashHelper.cs
- HttpAsyncResult.cs
- LayoutTable.cs
- InheritanceContextHelper.cs
- BStrWrapper.cs
- DayRenderEvent.cs
- DetailsViewDeleteEventArgs.cs
- BrowserDefinitionCollection.cs
- indexingfiltermarshaler.cs
- ConnectionManagementElementCollection.cs
- RightsManagementEncryptedStream.cs
- FramingDecoders.cs
- InvokeHandlers.cs
- TypeUtil.cs
- CodeConstructor.cs
- WebPartConnectionsConfigureVerb.cs
- TextClipboardData.cs
- KeyedPriorityQueue.cs
- AutomationIdentifierGuids.cs
- BamlRecordHelper.cs
- WindowsStatic.cs
- ObjectDataSourceSelectingEventArgs.cs
- DesignerActionItem.cs
- PassportAuthentication.cs
- CodeAttachEventStatement.cs
- PermissionSetEnumerator.cs
- StreamUpdate.cs
- XhtmlBasicObjectListAdapter.cs
- IndexedString.cs
- Rule.cs
- ToolStripRendererSwitcher.cs
- SocketManager.cs
- SchemaContext.cs
- ExpandSegmentCollection.cs
- DataList.cs
- OptimizedTemplateContentHelper.cs
- ProcessInputEventArgs.cs
- SqlServices.cs
- Axis.cs
- _SpnDictionary.cs
- NamespaceCollection.cs
- ConditionalAttribute.cs
- SafeWaitHandle.cs
- PrincipalPermission.cs
- CriticalExceptions.cs
- InternalException.cs
- LassoHelper.cs
- Speller.cs
- RecognitionResult.cs
- PositiveTimeSpanValidator.cs
- _NtlmClient.cs
- InertiaRotationBehavior.cs
- PlaceHolder.cs
- FrameworkPropertyMetadata.cs
- DesignerAutoFormat.cs
- ProcessMessagesAsyncResult.cs
- DataGrid.cs
- XmlAttributeOverrides.cs
- SystemIcons.cs
- WebPart.cs
- CheckBoxField.cs
- XmlDeclaration.cs
- FixedSOMFixedBlock.cs
- Queue.cs
- Quad.cs
- SiteMapNodeItem.cs
- FrugalList.cs
- FormatPage.cs
- RegexRunner.cs
- coordinator.cs
- Panel.cs
- Encoder.cs
- FrameworkElement.cs
- EventLogEntry.cs
- MouseOverProperty.cs
- RowToParametersTransformer.cs