Skip to content

[API Proposal]: AesGcm/AesCcm.KeySize #72191

Description

@sdrapkin

API Proposal

namespace System.Security.Cryptography;

public partial class AesGcm
{
    public int KeySize { get; }
}

public partial class AesCcm
{
    public int KeySize { get; }
}

API Usage

void OnlyAesGcm256(AesGcm gcm)
{
    const int ALLOWED_KEY_SIZE = 256;
    if (gcm.KeySize != ALLOWED_KEY_SIZE) throw new CryptographicException();
    // do stuff
}

Alternative Designs

No response

Risks

New APIs. No breaking changes/risks. No performance regressions/impacts.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions