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
- RestHandler.cs
- RoleManagerModule.cs
- CompilerError.cs
- SocketPermission.cs
- CodeMemberEvent.cs
- TargetControlTypeAttribute.cs
- TextEffectResolver.cs
- ArrayConverter.cs
- OrderPreservingPipeliningMergeHelper.cs
- QueryValue.cs
- ContainerControl.cs
- Dispatcher.cs
- Context.cs
- PropertyValueEditor.cs
- WebBrowser.cs
- SpellerError.cs
- JsonReaderWriterFactory.cs
- brushes.cs
- StateMachineSubscriptionManager.cs
- PropertyGridEditorPart.cs
- URI.cs
- WindowsScroll.cs
- MediaContextNotificationWindow.cs
- PropertyPathConverter.cs
- ColorDialog.cs
- DbMetaDataColumnNames.cs
- AutomationPropertyInfo.cs
- IIS7UserPrincipal.cs
- OleDbConnectionFactory.cs
- HealthMonitoringSection.cs
- ColumnMapCopier.cs
- NumberSubstitution.cs
- ControlBuilderAttribute.cs
- _AutoWebProxyScriptWrapper.cs
- IssuanceLicense.cs
- MemberHolder.cs
- Constants.cs
- ListView.cs
- TableCell.cs
- SQLChars.cs
- TokenizerHelper.cs
- StateMachineHelpers.cs
- SqlBuilder.cs
- ContainerFilterService.cs
- HttpHostedTransportConfiguration.cs
- shaper.cs
- ArcSegment.cs
- ReadOnlyCollectionBuilder.cs
- EdmProviderManifest.cs
- NullNotAllowedCollection.cs
- AsyncDataRequest.cs
- SafeWaitHandle.cs
- assemblycache.cs
- HelloOperation11AsyncResult.cs
- DPTypeDescriptorContext.cs
- URLIdentityPermission.cs
- DataGridCommandEventArgs.cs
- WebServiceClientProxyGenerator.cs
- ArrayWithOffset.cs
- XmlSchemaAttributeGroup.cs
- TemplateBindingExtensionConverter.cs
- ButtonStandardAdapter.cs
- RowVisual.cs
- ExpressionBindingCollection.cs
- FunctionDescription.cs
- DataGridViewCellCancelEventArgs.cs
- OutputCacheModule.cs
- ScaleTransform.cs
- DBNull.cs
- CodeSubDirectoriesCollection.cs
- OleDbInfoMessageEvent.cs
- FrameworkContextData.cs
- WebHttpBinding.cs
- DefaultExpressionVisitor.cs
- WebPartHelpVerb.cs
- UIElementParagraph.cs
- DesignerProperties.cs
- CompilerScope.Storage.cs
- ObjectPersistData.cs
- HtmlMeta.cs
- Quaternion.cs
- StaticResourceExtension.cs
- XPathCompileException.cs
- DataColumnCollection.cs
- DiscreteKeyFrames.cs
- ReflectEventDescriptor.cs
- WebReferenceCollection.cs
- ArgumentException.cs
- XmlNamespaceMapping.cs
- RelationshipDetailsCollection.cs
- Drawing.cs
- LoginNameDesigner.cs
- FormViewInsertedEventArgs.cs
- ScriptingProfileServiceSection.cs
- Tool.cs
- SqlStream.cs
- RoutedPropertyChangedEventArgs.cs
- WebPartAddingEventArgs.cs
- ContactManager.cs
- EntityProviderServices.cs