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
- MaterialGroup.cs
- TextTreeExtractElementUndoUnit.cs
- Main.cs
- UpdateException.cs
- Span.cs
- PeerHopCountAttribute.cs
- WorkflowCommandExtensionItem.cs
- ImageAutomationPeer.cs
- DataGridViewMethods.cs
- DbProviderFactories.cs
- PathGradientBrush.cs
- RolePrincipal.cs
- SqlTypeConverter.cs
- Utilities.cs
- XmlCharacterData.cs
- CodeIdentifier.cs
- InputBinder.cs
- SerializationFieldInfo.cs
- AuthenticationModuleElementCollection.cs
- StrokeNode.cs
- pingexception.cs
- SqlDataSourceCache.cs
- lengthconverter.cs
- TypeExtensions.cs
- DataTableClearEvent.cs
- WebPartHelpVerb.cs
- SelectionRange.cs
- _TLSstream.cs
- ToolStripButton.cs
- HandlerBase.cs
- SqlDataSourceCommandEventArgs.cs
- TreeNode.cs
- DrawingContextDrawingContextWalker.cs
- AsyncContentLoadedEventArgs.cs
- PrintController.cs
- ComponentConverter.cs
- TTSVoice.cs
- MarginCollapsingState.cs
- WCFBuildProvider.cs
- SinglePageViewer.cs
- streamingZipPartStream.cs
- DbException.cs
- C14NUtil.cs
- XmlNodeReader.cs
- CodeDomComponentSerializationService.cs
- BitmapEffectDrawingContextWalker.cs
- SessionParameter.cs
- HasCopySemanticsAttribute.cs
- SerializationBinder.cs
- XmlAttributeCollection.cs
- ScrollItemPattern.cs
- ColorConverter.cs
- FormViewUpdateEventArgs.cs
- CapabilitiesAssignment.cs
- HybridDictionary.cs
- _ConnectionGroup.cs
- WebPartTransformerAttribute.cs
- Timer.cs
- DataGridParentRows.cs
- VectorAnimationBase.cs
- WebHeaderCollection.cs
- MessageAction.cs
- __Filters.cs
- DEREncoding.cs
- HtmlControl.cs
- EnumerableRowCollectionExtensions.cs
- RoleGroupCollection.cs
- TypedServiceOperationListItem.cs
- Rect.cs
- SelectionService.cs
- Publisher.cs
- TextBoxLine.cs
- HybridDictionary.cs
- CompositionCommandSet.cs
- StorageComplexTypeMapping.cs
- XmlDataSourceNodeDescriptor.cs
- JobCollate.cs
- CodeGeneratorOptions.cs
- ModelUIElement3D.cs
- FrameworkContentElement.cs
- adornercollection.cs
- ProgressBar.cs
- HighContrastHelper.cs
- GcSettings.cs
- AmbiguousMatchException.cs
- CodeDelegateInvokeExpression.cs
- XmlSerializer.cs
- DataGridViewSelectedColumnCollection.cs
- CapabilitiesSection.cs
- BitmapEffect.cs
- ConfigurationPropertyAttribute.cs
- RowToFieldTransformer.cs
- TripleDES.cs
- DocumentGridPage.cs
- RawKeyboardInputReport.cs
- ExtensionWindowHeader.cs
- CompilerLocalReference.cs
- SecurityContext.cs
- TextTrailingWordEllipsis.cs
- ListViewCommandEventArgs.cs