Skip to content

Deprecate PKey.generate_key, PKey.check, and dump_privatekey#1509

Merged
reaperhulk merged 1 commit into
mainfrom
claude/deprecate-pkey-dump-privatekey
Jun 7, 2026
Merged

Deprecate PKey.generate_key, PKey.check, and dump_privatekey#1509
reaperhulk merged 1 commit into
mainfrom
claude/deprecate-pkey-dump-privatekey

Conversation

@alex

@alex alex commented Jun 7, 2026

Copy link
Copy Markdown
Member

Deprecates PKey.generate_key, PKey.check, and dump_privatekey in favor of the key generation, loading, and serialization APIs in cryptography.

  • The PKey methods use the @deprecated decorator (same as get_elliptic_curve(s)), so mypy flags them with --enable-error-code deprecated.
  • dump_privatekey follows the dump_certificate_request precedent (utils.deprecated + a _dump_privatekey_internal alias) since it's called internally by PKey.to_cryptography_key, which remains warning-free.

The X509Name deprecations are split out and on hold pending the get_client_ca_list as_cryptography work (#1508).

https://claude.ai/code/session_01KzTRkDmWNuEfCubRUhVit5


Generated by Claude Code

The key generation, loading, and serialization APIs in cryptography
should be used instead.

https://claude.ai/code/session_01KzTRkDmWNuEfCubRUhVit5
@reaperhulk reaperhulk merged commit e096920 into main Jun 7, 2026
79 checks passed
@alex alex deleted the claude/deprecate-pkey-dump-privatekey branch June 7, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants