Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- ProcessModuleDesigner.cs
- XPathSelectionIterator.cs
- MouseWheelEventArgs.cs
- ExceptionHandlers.cs
- TraceFilter.cs
- MemberInitExpression.cs
- HtmlTextArea.cs
- DocumentProperties.cs
- PolyBezierSegmentFigureLogic.cs
- MachineKeySection.cs
- Int32CollectionValueSerializer.cs
- XsdCachingReader.cs
- __Error.cs
- TextContainerHelper.cs
- DeobfuscatingStream.cs
- NetworkAddressChange.cs
- AssemblyUtil.cs
- FileSystemEventArgs.cs
- _UncName.cs
- CollectionConverter.cs
- LocalValueEnumerator.cs
- FacetValues.cs
- SignatureHelper.cs
- CommonProperties.cs
- TemplateControlBuildProvider.cs
- StylusPointProperty.cs
- SecurityAccessDeniedException.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- CLSCompliantAttribute.cs
- FacetDescriptionElement.cs
- DataErrorValidationRule.cs
- CollectionBuilder.cs
- RotateTransform.cs
- HandlerBase.cs
- Label.cs
- wmiprovider.cs
- ExpandCollapsePattern.cs
- TaskScheduler.cs
- EntityParameterCollection.cs
- JpegBitmapDecoder.cs
- ItemCheckedEvent.cs
- JsonFaultDetail.cs
- ValueTypeFixupInfo.cs
- SymbolEqualComparer.cs
- SchemaComplexType.cs
- FlowPosition.cs
- EFAssociationProvider.cs
- PackageStore.cs
- ObjectSet.cs
- CharAnimationBase.cs
- UInt32Storage.cs
- TextRenderer.cs
- XmlSchemaCompilationSettings.cs
- RoleManagerModule.cs
- AmbientLight.cs
- SQLGuid.cs
- LocatorGroup.cs
- Automation.cs
- SelectionGlyphBase.cs
- ResXDataNode.cs
- ActivityTypeCodeDomSerializer.cs
- DataSourceCache.cs
- ServiceNameElementCollection.cs
- DataGridViewRowPrePaintEventArgs.cs
- RuleRefElement.cs
- DrawingBrush.cs
- Journal.cs
- HitTestFilterBehavior.cs
- DataGridClipboardHelper.cs
- XslTransform.cs
- StateMachineHistory.cs
- ResourceDescriptionAttribute.cs
- List.cs
- PropertyCondition.cs
- MimeTypePropertyAttribute.cs
- DynamicDataRoute.cs
- PermissionToken.cs
- Matrix3DConverter.cs
- LineUtil.cs
- SparseMemoryStream.cs
- PageRouteHandler.cs
- Tag.cs
- String.cs
- BreakRecordTable.cs
- PropertyToken.cs
- QueryContinueDragEventArgs.cs
- AbsoluteQuery.cs
- DataBinder.cs
- DesignerOptionService.cs
- DropAnimation.xaml.cs
- Pen.cs
- ColumnResizeAdorner.cs
- WindowsEditBox.cs
- DataGridViewColumnStateChangedEventArgs.cs
- DescendantOverDescendantQuery.cs
- ParentQuery.cs
- SqlStream.cs
- DataGridTextBoxColumn.cs
- SimpleType.cs
- NodeLabelEditEvent.cs