Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Cryptography / HMACSHA1.cs / 1305376 / 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 FEATURE_CRYPTO
if (useManagedSha1) {
#endif // FEATURE_CRYPTO
m_hash1 = new SHA1Managed();
m_hash2 = new SHA1Managed();
#if FEATURE_CRYPTO
} else {
m_hash1 = new SHA1CryptoServiceProvider();
m_hash2 = new SHA1CryptoServiceProvider();
}
#endif // FEATURE_CRYPTO
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 FEATURE_CRYPTO
if (useManagedSha1) {
#endif // FEATURE_CRYPTO
m_hash1 = new SHA1Managed();
m_hash2 = new SHA1Managed();
#if FEATURE_CRYPTO
} else {
m_hash1 = new SHA1CryptoServiceProvider();
m_hash2 = new SHA1CryptoServiceProvider();
}
#endif // FEATURE_CRYPTO
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
- ConditionalBranch.cs
- DelegateBodyWriter.cs
- PanelStyle.cs
- FileEnumerator.cs
- AvTraceDetails.cs
- DetailsViewInsertedEventArgs.cs
- SmiEventSink.cs
- WebServiceClientProxyGenerator.cs
- WebBrowserSiteBase.cs
- SoapAttributeOverrides.cs
- FrameworkObject.cs
- MultiTouchSystemGestureLogic.cs
- PreProcessor.cs
- Renderer.cs
- FixedPageAutomationPeer.cs
- ScriptServiceAttribute.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- ApplicationDirectoryMembershipCondition.cs
- DataGridCellsPanel.cs
- ObjectManager.cs
- PathGeometry.cs
- EncoderBestFitFallback.cs
- EntityDataSourceDesignerHelper.cs
- MimeMapping.cs
- SrgsGrammar.cs
- DetailsViewPageEventArgs.cs
- baseaxisquery.cs
- ParameterEditorUserControl.cs
- UniqueConstraint.cs
- CodeEntryPointMethod.cs
- ExtenderProvidedPropertyAttribute.cs
- ContainerControl.cs
- ProgressChangedEventArgs.cs
- ActivityIdHeader.cs
- EventHandlingScope.cs
- FixedSchema.cs
- CodeSpit.cs
- RTLAwareMessageBox.cs
- COM2ExtendedUITypeEditor.cs
- DurableOperationAttribute.cs
- MatrixValueSerializer.cs
- SmiEventSink_Default.cs
- FileDialogCustomPlace.cs
- RowUpdatingEventArgs.cs
- ApplicationSecurityInfo.cs
- HostedTransportConfigurationManager.cs
- HtmlInputText.cs
- Location.cs
- CollectionsUtil.cs
- SqlDataSource.cs
- COM2PropertyPageUITypeConverter.cs
- BitmapVisualManager.cs
- ComponentEditorForm.cs
- Propagator.Evaluator.cs
- FileFormatException.cs
- KeySplineConverter.cs
- securestring.cs
- FrugalMap.cs
- TableStyle.cs
- Quad.cs
- XmlWhitespace.cs
- FontInfo.cs
- NoneExcludedImageIndexConverter.cs
- QilReplaceVisitor.cs
- LifetimeServices.cs
- SystemIPAddressInformation.cs
- DataRecordInternal.cs
- DefinitionUpdate.cs
- NameValueSectionHandler.cs
- ListItemCollection.cs
- DuplicateWaitObjectException.cs
- SingleConverter.cs
- AssociationSetEnd.cs
- EllipticalNodeOperations.cs
- TextLineBreak.cs
- LocalizableAttribute.cs
- HtmlLink.cs
- WindowsMenu.cs
- InstancePersistenceEvent.cs
- OdbcError.cs
- InheritanceContextChangedEventManager.cs
- Color.cs
- PointConverter.cs
- SerializationHelper.cs
- NeedSkipTokenVisitor.cs
- DesignerSerializationManager.cs
- TransformerTypeCollection.cs
- OleStrCAMarshaler.cs
- IImplicitResourceProvider.cs
- CompiledQuery.cs
- Normalizer.cs
- TemplateField.cs
- DtdParser.cs
- TdsParserSafeHandles.cs
- BitmapEffectState.cs
- SharedConnectionInfo.cs
- XmlNodeReader.cs
- SynthesizerStateChangedEventArgs.cs
- ImageListUtils.cs
- XmlLoader.cs