Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Cryptography / PKCS1MaskGenerationMethod.cs / 1305376 / PKCS1MaskGenerationMethod.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //[....] // namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public class PKCS1MaskGenerationMethod : MaskGenerationMethod { private String HashNameValue; // // public constructors // public PKCS1MaskGenerationMethod() { HashNameValue = "SHA1"; } // // public properties // public String HashName { get { return HashNameValue; } set { HashNameValue = value; if (HashNameValue == null) { HashNameValue = "SHA1"; } } } // // public methods // [System.Security.SecuritySafeCritical] // auto-generated public override byte[] GenerateMask(byte[] rgbSeed, int cbReturn) { HashAlgorithm hash = (HashAlgorithm) CryptoConfig.CreateFromName(HashNameValue); byte[] rgbCounter = new byte[4]; byte[] rgbT = new byte[cbReturn]; uint counter = 0; for (int ib=0; ib_hash.Length) { Buffer.BlockCopy(_hash, 0, rgbT, ib, _hash.Length); } else { Buffer.BlockCopy(_hash, 0, rgbT, ib, rgbT.Length - ib); } ib += hash.Hash.Length; } return rgbT; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // [....] // namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public class PKCS1MaskGenerationMethod : MaskGenerationMethod { private String HashNameValue; // // public constructors // public PKCS1MaskGenerationMethod() { HashNameValue = "SHA1"; } // // public properties // public String HashName { get { return HashNameValue; } set { HashNameValue = value; if (HashNameValue == null) { HashNameValue = "SHA1"; } } } // // public methods // [System.Security.SecuritySafeCritical] // auto-generated public override byte[] GenerateMask(byte[] rgbSeed, int cbReturn) { HashAlgorithm hash = (HashAlgorithm) CryptoConfig.CreateFromName(HashNameValue); byte[] rgbCounter = new byte[4]; byte[] rgbT = new byte[cbReturn]; uint counter = 0; for (int ib=0; ib_hash.Length) { Buffer.BlockCopy(_hash, 0, rgbT, ib, _hash.Length); } else { Buffer.BlockCopy(_hash, 0, rgbT, ib, rgbT.Length - ib); } ib += hash.Hash.Length; } return rgbT; } } } // 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
- SQLSingleStorage.cs
- CodeTypeDelegate.cs
- PropertyInformation.cs
- SelectionEditingBehavior.cs
- QueryTask.cs
- TouchesOverProperty.cs
- ConfigurationManagerHelper.cs
- IISUnsafeMethods.cs
- SelectingProviderEventArgs.cs
- StatusBarPanelClickEvent.cs
- mediaclock.cs
- SoapElementAttribute.cs
- AddInStore.cs
- UdpChannelListener.cs
- StringValueSerializer.cs
- XmlMembersMapping.cs
- EmbossBitmapEffect.cs
- AppLevelCompilationSectionCache.cs
- StorageBasedPackageProperties.cs
- EncoderReplacementFallback.cs
- PrimitiveRenderer.cs
- NegationPusher.cs
- MetabaseServerConfig.cs
- CapabilitiesState.cs
- MediaContext.cs
- BStrWrapper.cs
- TimeSpan.cs
- ComponentResourceManager.cs
- DBCommand.cs
- WindowsFont.cs
- BookmarkTable.cs
- EntityViewGenerator.cs
- MdiWindowListStrip.cs
- CapabilitiesSection.cs
- PageBuildProvider.cs
- ReplacementText.cs
- Label.cs
- BitmapSizeOptions.cs
- XmlSchemaComplexType.cs
- CollectionViewSource.cs
- HtmlInputReset.cs
- Metadata.cs
- PasswordRecovery.cs
- GlobalizationSection.cs
- ComponentChangedEvent.cs
- UnSafeCharBuffer.cs
- CellTreeSimplifier.cs
- WebPartMovingEventArgs.cs
- XamlPathDataSerializer.cs
- MultiPageTextView.cs
- SecurityUniqueId.cs
- _SingleItemRequestCache.cs
- Registry.cs
- ConstructorArgumentAttribute.cs
- Page.cs
- DurableInstanceProvider.cs
- DataServiceException.cs
- TeredoHelper.cs
- ProfileGroupSettings.cs
- Missing.cs
- AspNetHostingPermission.cs
- NativeMethods.cs
- SettingsPropertyCollection.cs
- XmlReader.cs
- AsyncPostBackErrorEventArgs.cs
- SQLSingle.cs
- CompressEmulationStream.cs
- EntityStoreSchemaFilterEntry.cs
- CodeTypeReferenceExpression.cs
- OracleSqlParser.cs
- Italic.cs
- SessionStateContainer.cs
- LockingPersistenceProvider.cs
- Decorator.cs
- RunClient.cs
- CompilerCollection.cs
- CultureMapper.cs
- MessageBox.cs
- AuthenticationSection.cs
- GridPattern.cs
- SqlDataSourceCustomCommandEditor.cs
- SHA512Managed.cs
- HtmlString.cs
- Fault.cs
- UnitySerializationHolder.cs
- XmlDocumentFieldSchema.cs
- CommandTreeTypeHelper.cs
- TimeSpanValidator.cs
- UserControl.cs
- OpCodes.cs
- SqlConnectionHelper.cs
- WinEventHandler.cs
- MouseEventArgs.cs
- PageContentAsyncResult.cs
- AuthenticatedStream.cs
- TreeBuilder.cs
- FloaterBaseParaClient.cs
- XmlQualifiedNameTest.cs
- _OverlappedAsyncResult.cs
- TableColumn.cs