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
- AttachmentCollection.cs
- PartialTrustHelpers.cs
- XPathDocument.cs
- ISAPIApplicationHost.cs
- CloudCollection.cs
- TraceProvider.cs
- ContentFilePart.cs
- CodeObject.cs
- SrgsNameValueTag.cs
- ContextMenuAutomationPeer.cs
- GeneralTransform3DTo2DTo3D.cs
- Tokenizer.cs
- RowParagraph.cs
- PropertyChangedEventManager.cs
- RegexBoyerMoore.cs
- ThreadInterruptedException.cs
- RootBuilder.cs
- OleDbReferenceCollection.cs
- HierarchicalDataSourceControl.cs
- BypassElementCollection.cs
- ModelPropertyCollectionImpl.cs
- ApplicationSecurityManager.cs
- WebHttpSecurityElement.cs
- WindowsSpinner.cs
- ItemContainerPattern.cs
- _SingleItemRequestCache.cs
- SelectionItemProviderWrapper.cs
- SchemaElementDecl.cs
- WrappedIUnknown.cs
- ObjectListTitleAttribute.cs
- shaperfactoryquerycachekey.cs
- CompensateDesigner.cs
- WebPartTracker.cs
- EncryptedData.cs
- cryptoapiTransform.cs
- AttributeConverter.cs
- AvTraceFormat.cs
- StylusEventArgs.cs
- SqlCacheDependencyDatabaseCollection.cs
- SizeLimitedCache.cs
- DesignerHost.cs
- HelpEvent.cs
- ITextView.cs
- SHA1CryptoServiceProvider.cs
- ZipIOLocalFileDataDescriptor.cs
- streamingZipPartStream.cs
- ImportCatalogPart.cs
- FlowSwitchLink.cs
- HtmlFormWrapper.cs
- TextParagraphView.cs
- DataRelation.cs
- ChooseAction.cs
- HtmlInputSubmit.cs
- SqlParameterizer.cs
- MultitargetUtil.cs
- SecurityDescriptor.cs
- Unit.cs
- GrammarBuilderRuleRef.cs
- shaper.cs
- QueryAccessibilityHelpEvent.cs
- initElementDictionary.cs
- IDataContractSurrogate.cs
- MediaPlayer.cs
- KeyConverter.cs
- UIPermission.cs
- SoapBinding.cs
- SignerInfo.cs
- RTLAwareMessageBox.cs
- DataGridCaption.cs
- TreeChangeInfo.cs
- MarshalDirectiveException.cs
- CodeTypeDeclaration.cs
- IPAddressCollection.cs
- ZipIOExtraFieldPaddingElement.cs
- HttpBufferlessInputStream.cs
- Normalization.cs
- XamlToRtfWriter.cs
- SQLBinary.cs
- VirtualDirectoryMapping.cs
- MostlySingletonList.cs
- NegatedCellConstant.cs
- PathData.cs
- RegexRunner.cs
- TemplateComponentConnector.cs
- SQLInt64Storage.cs
- StandardToolWindows.cs
- ActivityPreviewDesigner.cs
- HttpContext.cs
- TableRowCollection.cs
- Subtree.cs
- ProbeMatchesApril2005.cs
- SQLInt32Storage.cs
- IconHelper.cs
- ConfigXmlSignificantWhitespace.cs
- TaskFormBase.cs
- IResourceProvider.cs
- TableLayoutPanelCellPosition.cs
- Camera.cs
- RemotingException.cs
- DesignTimeVisibleAttribute.cs