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
- COM2IDispatchConverter.cs
- BookmarkScopeInfo.cs
- OciLobLocator.cs
- OperandQuery.cs
- DPCustomTypeDescriptor.cs
- SafeNativeMethods.cs
- ProfileSection.cs
- XmlCountingReader.cs
- SessionStateModule.cs
- FieldMetadata.cs
- SubqueryTrackingVisitor.cs
- LateBoundBitmapDecoder.cs
- DesignerHelpers.cs
- MenuScrollingVisibilityConverter.cs
- TextSimpleMarkerProperties.cs
- RegexRunner.cs
- ISO2022Encoding.cs
- Convert.cs
- CodeArgumentReferenceExpression.cs
- HtmlTernaryTree.cs
- OdbcConnectionOpen.cs
- TableFieldsEditor.cs
- WeakReferenceList.cs
- HotCommands.cs
- BitmapEffectState.cs
- DeferredSelectedIndexReference.cs
- DataTableExtensions.cs
- MemberRelationshipService.cs
- ThumbButtonInfo.cs
- ParsedAttributeCollection.cs
- DataGridViewEditingControlShowingEventArgs.cs
- ServicePointManagerElement.cs
- PathFigureCollection.cs
- JoinElimination.cs
- WmfPlaceableFileHeader.cs
- TextAction.cs
- ExceptionUtil.cs
- MouseCaptureWithinProperty.cs
- CommandValueSerializer.cs
- TraceSource.cs
- NotifyInputEventArgs.cs
- StructureChangedEventArgs.cs
- CompositeActivityDesigner.cs
- WpfPayload.cs
- XmlSerializerVersionAttribute.cs
- OuterGlowBitmapEffect.cs
- ClientFormsIdentity.cs
- XhtmlTextWriter.cs
- CroppedBitmap.cs
- itemelement.cs
- OutputWindow.cs
- RadioButtonAutomationPeer.cs
- DirectoryNotFoundException.cs
- SimpleHandlerFactory.cs
- ScrollProviderWrapper.cs
- TemplateXamlParser.cs
- SqlXmlStorage.cs
- AppearanceEditorPart.cs
- WebServiceFault.cs
- FormsAuthentication.cs
- ZipIOModeEnforcingStream.cs
- LicenseManager.cs
- ArithmeticException.cs
- Int16Storage.cs
- Rotation3DAnimationBase.cs
- FixedTextPointer.cs
- EdmRelationshipRoleAttribute.cs
- Container.cs
- FragmentQueryProcessor.cs
- SignatureResourcePool.cs
- DataGridParentRows.cs
- SmiSettersStream.cs
- DirtyTextRange.cs
- FixedBufferAttribute.cs
- XmlDataLoader.cs
- DataSourceControlBuilder.cs
- NativeCppClassAttribute.cs
- Listbox.cs
- SendMailErrorEventArgs.cs
- Task.cs
- ToolStripPanelCell.cs
- DesignerForm.cs
- AlternateView.cs
- RedBlackList.cs
- StringResourceManager.cs
- XmlEntityReference.cs
- QilTernary.cs
- TableParaClient.cs
- VirtualizedItemPattern.cs
- SettingsAttributes.cs
- CapabilitiesPattern.cs
- ScrollData.cs
- XmlSchemaAnnotated.cs
- HostingMessageProperty.cs
- KeyMatchBuilder.cs
- XmlStringTable.cs
- ScrollProperties.cs
- WebPartEventArgs.cs
- StreamedWorkflowDefinitionContext.cs
- DataGridTextBoxColumn.cs