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
- RegistryPermission.cs
- RowToParametersTransformer.cs
- UIElementParaClient.cs
- HttpStreamMessage.cs
- NetworkAddressChange.cs
- ProcessThreadCollection.cs
- ImplicitInputBrush.cs
- SelectedGridItemChangedEvent.cs
- QilNode.cs
- ErrorTableItemStyle.cs
- ContractNamespaceAttribute.cs
- RuntimeCompatibilityAttribute.cs
- Empty.cs
- DbDeleteCommandTree.cs
- HMAC.cs
- CodeGenHelper.cs
- Figure.cs
- CodeTypeReferenceExpression.cs
- PrimitiveXmlSerializers.cs
- PersonalizablePropertyEntry.cs
- Condition.cs
- XmlSchemaSimpleContent.cs
- RawUIStateInputReport.cs
- ConsumerConnectionPointCollection.cs
- ActivityDesignerLayoutSerializers.cs
- WinFormsComponentEditor.cs
- HttpListenerResponse.cs
- SmtpNegotiateAuthenticationModule.cs
- TableLayoutColumnStyleCollection.cs
- BaseTreeIterator.cs
- FileRegion.cs
- XPathCompiler.cs
- BuilderElements.cs
- ThaiBuddhistCalendar.cs
- RegexReplacement.cs
- ListDictionaryInternal.cs
- FormViewModeEventArgs.cs
- SelfIssuedAuthProofToken.cs
- PropertyNames.cs
- SoapIgnoreAttribute.cs
- WindowsSlider.cs
- CodeLabeledStatement.cs
- TextEditorTyping.cs
- KeyGestureConverter.cs
- ComPersistableTypeElement.cs
- DispatchWrapper.cs
- SafeLibraryHandle.cs
- IconConverter.cs
- PersistenceProviderElement.cs
- SelectorItemAutomationPeer.cs
- ConfigurationSectionGroupCollection.cs
- ConfigurationManagerInternalFactory.cs
- CodeTypeReferenceCollection.cs
- GridViewUpdatedEventArgs.cs
- SQLUtility.cs
- SmtpReplyReaderFactory.cs
- ToolBarTray.cs
- MenuBase.cs
- BooleanSwitch.cs
- SystemWebSectionGroup.cs
- CqlQuery.cs
- CompModSwitches.cs
- RoutedEventHandlerInfo.cs
- TypedMessageConverter.cs
- BaseTreeIterator.cs
- BuildResultCache.cs
- ISAPIApplicationHost.cs
- XpsS0ValidatingLoader.cs
- MemoryMappedViewStream.cs
- ClassImporter.cs
- PageCatalogPartDesigner.cs
- FlowDocumentPaginator.cs
- DocumentPage.cs
- HwndStylusInputProvider.cs
- ColorTransform.cs
- UnicastIPAddressInformationCollection.cs
- PanelContainerDesigner.cs
- Span.cs
- XmlSchemaProviderAttribute.cs
- NativeMethods.cs
- _ConnectStream.cs
- FileLogRecordStream.cs
- CachedBitmap.cs
- DataRelation.cs
- EditorZoneBase.cs
- Inline.cs
- XmlHierarchicalDataSourceView.cs
- ModifiableIteratorCollection.cs
- RC2.cs
- ReceiveActivity.cs
- TimelineGroup.cs
- SourceElementsCollection.cs
- DriveInfo.cs
- RuleSettingsCollection.cs
- DataGridViewCellValueEventArgs.cs
- Shared.cs
- CodeStatementCollection.cs
- KeyFrames.cs
- ResourceManager.cs
- Registration.cs