Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Cryptography / Aes.cs / 1305376 / Aes.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
using System;
using System.Runtime.CompilerServices;
namespace System.Security.Cryptography {
///
/// Abstract base class for implementations of the AES algorithm
///
#if !FEATURE_CORECLR
[TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=b77a5c561934e089")]
#else // FEATURE_CORECLR
[TypeForwardedFrom("System.Core, Version=2.0.5.0, Culture=Neutral, PublicKeyToken=7cec85d7bea7798e")]
#endif // !FEATURE_CORECLR
public abstract class Aes : SymmetricAlgorithm {
private static KeySizes[] s_legalBlockSizes = { new KeySizes(128, 128, 0) };
private static KeySizes[] s_legalKeySizes = { new KeySizes(128, 256, 64) };
///
/// Setup the default values for AES encryption
///
protected Aes() {
LegalBlockSizesValue = s_legalBlockSizes;
LegalKeySizesValue = s_legalKeySizes;
BlockSizeValue = 128;
FeedbackSizeValue = 8;
KeySizeValue = 256;
ModeValue = CipherMode.CBC;
}
public static new Aes Create() {
return Create("AES");
}
public static new Aes Create(string algorithmName) {
if (algorithmName == null) {
throw new ArgumentNullException("algorithmName");
}
return CryptoConfig.CreateFromName(algorithmName) as Aes;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
using System;
using System.Runtime.CompilerServices;
namespace System.Security.Cryptography {
///
/// Abstract base class for implementations of the AES algorithm
///
#if !FEATURE_CORECLR
[TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=b77a5c561934e089")]
#else // FEATURE_CORECLR
[TypeForwardedFrom("System.Core, Version=2.0.5.0, Culture=Neutral, PublicKeyToken=7cec85d7bea7798e")]
#endif // !FEATURE_CORECLR
public abstract class Aes : SymmetricAlgorithm {
private static KeySizes[] s_legalBlockSizes = { new KeySizes(128, 128, 0) };
private static KeySizes[] s_legalKeySizes = { new KeySizes(128, 256, 64) };
///
/// Setup the default values for AES encryption
///
protected Aes() {
LegalBlockSizesValue = s_legalBlockSizes;
LegalKeySizesValue = s_legalKeySizes;
BlockSizeValue = 128;
FeedbackSizeValue = 8;
KeySizeValue = 256;
ModeValue = CipherMode.CBC;
}
public static new Aes Create() {
return Create("AES");
}
public static new Aes Create(string algorithmName) {
if (algorithmName == null) {
throw new ArgumentNullException("algorithmName");
}
return CryptoConfig.CreateFromName(algorithmName) as Aes;
}
}
}
// 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
- CodeSubDirectory.cs
- EncoderReplacementFallback.cs
- DefaultBinder.cs
- WindowsSysHeader.cs
- TabItemAutomationPeer.cs
- BinaryFormatter.cs
- StylusButtonEventArgs.cs
- EndOfStreamException.cs
- ChtmlFormAdapter.cs
- QilScopedVisitor.cs
- cookieexception.cs
- CodeComment.cs
- HtmlInputButton.cs
- ListViewHitTestInfo.cs
- StateValidator.cs
- WebBrowserSiteBase.cs
- QueryAccessibilityHelpEvent.cs
- SharedDp.cs
- ContractReference.cs
- ThreadStaticAttribute.cs
- DataGridViewCellParsingEventArgs.cs
- TreeNodeCollection.cs
- NonSerializedAttribute.cs
- ClientApiGenerator.cs
- PerformanceCounterManager.cs
- Storyboard.cs
- ValidationResult.cs
- CompModHelpers.cs
- JsonWriter.cs
- SchemaElementLookUpTable.cs
- ObjectDataSourceView.cs
- DetailsViewDesigner.cs
- diagnosticsswitches.cs
- WebPart.cs
- GZipStream.cs
- AdapterDictionary.cs
- CustomCategoryAttribute.cs
- DataServiceProcessingPipelineEventArgs.cs
- DataBindingHandlerAttribute.cs
- ApplicationSecurityManager.cs
- SymbolEqualComparer.cs
- BitmapData.cs
- CodeDomConfigurationHandler.cs
- ConfigurationProperty.cs
- ProcessManager.cs
- RenderData.cs
- WebPart.cs
- JournalNavigationScope.cs
- DataGridHeaderBorder.cs
- InstanceDataCollection.cs
- RegionIterator.cs
- InputGestureCollection.cs
- TdsEnums.cs
- NestedContainer.cs
- CodeGenerator.cs
- WebServiceEnumData.cs
- ToolStripHighContrastRenderer.cs
- GeneralTransformGroup.cs
- BuildManagerHost.cs
- UnionExpr.cs
- PrimitiveCodeDomSerializer.cs
- SizeConverter.cs
- SynchronizationValidator.cs
- ToolStripComboBox.cs
- WebReferenceCollection.cs
- EntityContainerEmitter.cs
- SmtpDigestAuthenticationModule.cs
- BuilderInfo.cs
- OracleNumber.cs
- DoubleKeyFrameCollection.cs
- Nullable.cs
- PeerNode.cs
- ObjectParameterCollection.cs
- DataGridViewCellCollection.cs
- UIServiceHelper.cs
- AggregateNode.cs
- InvariantComparer.cs
- TypeExtension.cs
- SystemIcmpV4Statistics.cs
- ByteFacetDescriptionElement.cs
- EqualityComparer.cs
- TypeElement.cs
- Completion.cs
- PopupRoot.cs
- PasswordRecoveryDesigner.cs
- FigureParagraph.cs
- Mapping.cs
- Transaction.cs
- FilterableAttribute.cs
- TimeZone.cs
- CalendarDay.cs
- WindowsAuthenticationModule.cs
- OdbcPermission.cs
- PeerInvitationResponse.cs
- Int32RectValueSerializer.cs
- EventlogProvider.cs
- _AutoWebProxyScriptWrapper.cs
- ImageList.cs
- sqlser.cs
- Substitution.cs