Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- X509RawDataKeyIdentifierClause.cs
- IncrementalReadDecoders.cs
- PartitionedStream.cs
- ProviderSettingsCollection.cs
- TickBar.cs
- PersonalizationProvider.cs
- TextDocumentView.cs
- BamlResourceDeserializer.cs
- DisplayInformation.cs
- Panel.cs
- EventDescriptorCollection.cs
- GroupItem.cs
- RawStylusInputReport.cs
- DataTableReaderListener.cs
- ContentType.cs
- TypeUtil.cs
- TreeNodeStyle.cs
- CalendarTable.cs
- DBConnectionString.cs
- IdentityHolder.cs
- ValidationHelpers.cs
- SrgsSemanticInterpretationTag.cs
- UpdateTracker.cs
- ListSortDescription.cs
- SqlRemoveConstantOrderBy.cs
- CodeIdentifiers.cs
- SubMenuStyleCollectionEditor.cs
- RequestNavigateEventArgs.cs
- TableCell.cs
- CompiledQueryCacheEntry.cs
- TypedElement.cs
- AudioSignalProblemOccurredEventArgs.cs
- FactoryId.cs
- ProfileService.cs
- CombinedGeometry.cs
- ContentFilePart.cs
- FreeFormDesigner.cs
- TailCallAnalyzer.cs
- MessageBox.cs
- DictionaryCustomTypeDescriptor.cs
- KerberosTicketHashIdentifierClause.cs
- RichTextBoxDesigner.cs
- WebControlAdapter.cs
- DataTableMappingCollection.cs
- DelegatingTypeDescriptionProvider.cs
- HandleRef.cs
- Vars.cs
- WindowsFormsSynchronizationContext.cs
- TcpSocketManager.cs
- __FastResourceComparer.cs
- FirstQueryOperator.cs
- SafeNativeMethods.cs
- ScaleTransform.cs
- AutomationEventArgs.cs
- DeviceSpecificChoice.cs
- DbgUtil.cs
- FamilyCollection.cs
- WindowsListView.cs
- Grid.cs
- TypeSystemHelpers.cs
- MetadataUtilsSmi.cs
- MarkupProperty.cs
- HtmlGenericControl.cs
- SoundPlayer.cs
- IsolatedStoragePermission.cs
- SemanticResultKey.cs
- SymLanguageVendor.cs
- Attributes.cs
- ValidationManager.cs
- DispatcherOperation.cs
- ObjectAnimationUsingKeyFrames.cs
- DataGridViewTextBoxEditingControl.cs
- SafeRightsManagementHandle.cs
- DataColumnChangeEvent.cs
- mediapermission.cs
- SelectManyQueryOperator.cs
- ToolStripOverflow.cs
- AppDomainManager.cs
- GridErrorDlg.cs
- StringSorter.cs
- AttachedProperty.cs
- FilterQuery.cs
- XPathNodeInfoAtom.cs
- ObjectTag.cs
- ValidationRule.cs
- EdmFunctionAttribute.cs
- GenericTypeParameterConverter.cs
- FrameworkElementFactoryMarkupObject.cs
- RSAPKCS1KeyExchangeFormatter.cs
- DocumentReference.cs
- ClonableStack.cs
- PropertyRecord.cs
- CodeGotoStatement.cs
- JoinQueryOperator.cs
- WebPartsSection.cs
- MethodBuilder.cs
- NaturalLanguageHyphenator.cs
- CheckBoxAutomationPeer.cs
- DynamicRouteExpression.cs
- XmlWriterTraceListener.cs