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
- CommonProperties.cs
- SQLInt64.cs
- SafeLibraryHandle.cs
- ParameterCollectionEditorForm.cs
- MatrixTransform3D.cs
- FormCollection.cs
- XPathDocumentNavigator.cs
- ListViewDataItem.cs
- FrameDimension.cs
- ClientSponsor.cs
- _NestedMultipleAsyncResult.cs
- XPathDocument.cs
- Screen.cs
- TransactionScope.cs
- _CookieModule.cs
- PeerNearMe.cs
- _NTAuthentication.cs
- FlowDocumentPageViewerAutomationPeer.cs
- LazyTextWriterCreator.cs
- RemoteX509Token.cs
- Compiler.cs
- TextBox.cs
- BindingExpressionUncommonField.cs
- BooleanAnimationBase.cs
- DbModificationCommandTree.cs
- TextTreeInsertUndoUnit.cs
- ModuleBuilder.cs
- ServiceDescriptionImporter.cs
- RecommendedAsConfigurableAttribute.cs
- AbstractDataSvcMapFileLoader.cs
- ManagedFilter.cs
- Line.cs
- _IPv4Address.cs
- IdentityManager.cs
- CssTextWriter.cs
- DrawingAttributesDefaultValueFactory.cs
- handlecollector.cs
- ToolStripDropDownMenu.cs
- EllipseGeometry.cs
- ConnectionStringSettingsCollection.cs
- TableLayoutPanelBehavior.cs
- DateBoldEvent.cs
- FigureHelper.cs
- MouseButton.cs
- SecurityCriticalDataForSet.cs
- SecurityAccessDeniedException.cs
- SqlUserDefinedAggregateAttribute.cs
- BindingMAnagerBase.cs
- DockPanel.cs
- BindingExpressionBase.cs
- AssemblyAttributesGoHere.cs
- XPathSelectionIterator.cs
- ProvidersHelper.cs
- TextRunCache.cs
- DefinitionUpdate.cs
- ControlType.cs
- DataGridTable.cs
- FrameworkContentElementAutomationPeer.cs
- ImageListDesigner.cs
- Pair.cs
- StaticResourceExtension.cs
- UserControlBuildProvider.cs
- FixedSOMPageElement.cs
- RemoteArgument.cs
- ClientBuildManagerCallback.cs
- SuppressMessageAttribute.cs
- Calendar.cs
- ScriptingRoleServiceSection.cs
- AuthenticatedStream.cs
- CanonicalXml.cs
- __Error.cs
- ToolStripProgressBar.cs
- GenericTextProperties.cs
- Convert.cs
- UnsafeNativeMethods.cs
- SuppressedPackageProperties.cs
- WindowsTooltip.cs
- TextTreeObjectNode.cs
- DeferredReference.cs
- ToolStripScrollButton.cs
- ConfigurationSettings.cs
- CompoundFileDeflateTransform.cs
- VisualTransition.cs
- PieceDirectory.cs
- InvalidProgramException.cs
- MenuStrip.cs
- input.cs
- MissingFieldException.cs
- EtwTrackingParticipant.cs
- SQLGuidStorage.cs
- CodeAttributeDeclaration.cs
- OleDbParameterCollection.cs
- CurrentChangingEventArgs.cs
- CodeIdentifiers.cs
- WebPartZoneCollection.cs
- PolyBezierSegmentFigureLogic.cs
- externdll.cs
- ElapsedEventArgs.cs
- EncodingDataItem.cs
- WebPartConnectionsCancelEventArgs.cs