Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / clr / src / BCL / System / Security / Cryptography / PKCS1MaskGenerationMethod.cs / 1 / 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 // 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 // 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
- FaultPropagationRecord.cs
- EllipticalNodeOperations.cs
- StrongNameUtility.cs
- CultureTable.cs
- BaseParser.cs
- SecurityUtils.cs
- X509CertificateCollection.cs
- SpellCheck.cs
- Rules.cs
- SchemaLookupTable.cs
- IdentifierCollection.cs
- CommandSet.cs
- SynthesizerStateChangedEventArgs.cs
- EventProviderBase.cs
- DbModificationCommandTree.cs
- PointLight.cs
- SamlSecurityToken.cs
- UnmanagedMemoryStreamWrapper.cs
- CharAnimationBase.cs
- MembershipValidatePasswordEventArgs.cs
- DefaultHttpHandler.cs
- Drawing.cs
- OleDbCommand.cs
- LayoutSettings.cs
- EntityDataSourceChangingEventArgs.cs
- MetadataItemCollectionFactory.cs
- UniqueCodeIdentifierScope.cs
- IsolatedStorageFile.cs
- UnknownWrapper.cs
- MailAddress.cs
- ImageAnimator.cs
- SmtpCommands.cs
- RedirectionProxy.cs
- SizeConverter.cs
- DataGridViewHitTestInfo.cs
- LoginView.cs
- DesignParameter.cs
- ReadOnlyDataSourceView.cs
- BrowserCapabilitiesFactory35.cs
- SymDocumentType.cs
- BufferedResponseStream.cs
- XmlSignificantWhitespace.cs
- OperationAbortedException.cs
- BuiltInExpr.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- SmtpDigestAuthenticationModule.cs
- BrowsableAttribute.cs
- MarshalDirectiveException.cs
- ActivityXRefPropertyEditor.cs
- FamilyCollection.cs
- GenericArgumentsUpdater.cs
- PageBuildProvider.cs
- _SafeNetHandles.cs
- FixedTextContainer.cs
- SlotInfo.cs
- Variant.cs
- ApplicationDirectory.cs
- DerivedKeySecurityToken.cs
- SafeFileHandle.cs
- StylusTip.cs
- safesecurityhelperavalon.cs
- MemberAccessException.cs
- TextEncodedRawTextWriter.cs
- ResourceBinder.cs
- CustomGrammar.cs
- QuaternionValueSerializer.cs
- DataSourceHelper.cs
- WindowsToolbarAsMenu.cs
- SystemIPGlobalProperties.cs
- ObjectView.cs
- PrinterUnitConvert.cs
- ThreadStaticAttribute.cs
- IApplicationTrustManager.cs
- RootBrowserWindow.cs
- Root.cs
- CertificateManager.cs
- RightsManagementEncryptionTransform.cs
- XmlNodeReader.cs
- ScrollBar.cs
- dataSvcMapFileLoader.cs
- AppSettingsSection.cs
- DesignDataSource.cs
- WebPartUserCapability.cs
- ResXFileRef.cs
- DynamicActivityProperty.cs
- ChtmlCalendarAdapter.cs
- NewItemsContextMenuStrip.cs
- TableItemStyle.cs
- DocumentReference.cs
- EntityRecordInfo.cs
- LinqDataView.cs
- EventNotify.cs
- DomainUpDown.cs
- PersonalizationState.cs
- WorkflowViewElement.cs
- DirectoryObjectSecurity.cs
- _CacheStreams.cs
- ComponentCollection.cs
- RegisteredScript.cs
- ListViewEditEventArgs.cs