Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- Cell.cs
- WebEventCodes.cs
- TdsParser.cs
- ValidationErrorInfo.cs
- IdentifierCollection.cs
- Stylesheet.cs
- QilNode.cs
- ToolStripItemTextRenderEventArgs.cs
- XmlAttributeCollection.cs
- Message.cs
- QilScopedVisitor.cs
- AggregateNode.cs
- NullableFloatAverageAggregationOperator.cs
- SolidColorBrush.cs
- CollectionBase.cs
- DataTableExtensions.cs
- RtfControlWordInfo.cs
- GroupItem.cs
- Rect3D.cs
- TrustManagerPromptUI.cs
- EasingFunctionBase.cs
- SQLBinaryStorage.cs
- ContainerSelectorBehavior.cs
- FormsAuthentication.cs
- KeySplineConverter.cs
- Encoding.cs
- OperatingSystem.cs
- diagnosticsswitches.cs
- GradientBrush.cs
- BatchWriter.cs
- ScrollPattern.cs
- DesignerActionGlyph.cs
- WindowsRebar.cs
- LinkLabel.cs
- ObjectSecurity.cs
- Menu.cs
- HtmlWindow.cs
- CreateUserWizard.cs
- XNodeValidator.cs
- ConfigXmlDocument.cs
- PresentationTraceSources.cs
- FileAuthorizationModule.cs
- UserPreferenceChangingEventArgs.cs
- ComponentManagerBroker.cs
- _NegotiateClient.cs
- Win32MouseDevice.cs
- UnitySerializationHolder.cs
- IApplicationTrustManager.cs
- CachedPathData.cs
- SmiContext.cs
- ManifestResourceInfo.cs
- CodeFieldReferenceExpression.cs
- XamlToRtfParser.cs
- ShaderRenderModeValidation.cs
- ResourcePart.cs
- HttpWebRequestElement.cs
- AnnotationMap.cs
- DataGridViewLinkColumn.cs
- IntSecurity.cs
- StorageInfo.cs
- RenameRuleObjectDialog.Designer.cs
- _ShellExpression.cs
- ErrorInfoXmlDocument.cs
- RuleSettingsCollection.cs
- AuthenticationConfig.cs
- AutomationProperties.cs
- AbandonedMutexException.cs
- SchemaTableColumn.cs
- Rotation3D.cs
- StrokeNodeOperations.cs
- SqlConnectionString.cs
- ImpersonationContext.cs
- Grid.cs
- AsymmetricKeyExchangeDeformatter.cs
- Point3DCollectionValueSerializer.cs
- ProviderConnectionPoint.cs
- InvokeGenerator.cs
- ObjectTag.cs
- FileDocument.cs
- ClaimTypes.cs
- XPathBinder.cs
- ReadOnlyHierarchicalDataSourceView.cs
- InputGestureCollection.cs
- ToolboxItemAttribute.cs
- CustomAttributeSerializer.cs
- PropertySet.cs
- ParameterElementCollection.cs
- SignatureResourcePool.cs
- Accessible.cs
- DbUpdateCommandTree.cs
- UnsafeNativeMethods.cs
- HttpCookieCollection.cs
- BypassElement.cs
- GridViewCancelEditEventArgs.cs
- BitHelper.cs
- NativeMethods.cs
- metadatamappinghashervisitor.cs
- BookmarkEventArgs.cs
- ValidationError.cs
- ResolveMatchesMessageCD1.cs