paramiko / paramiko/paramiko

PKCS8

Open
#2,144 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Keys Needs policy decision
Dominant language
Python
Stars
9.9k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

Add a support for modern Key serialization into Transport class. Currently only support of PKCS#1 is present, modern serialization PKCS8 could not be used.

Eg. RSA key generated with:

from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization

RSAKeyGen = rsa.generate_private_key(public_exponent=65537,key_size=4096)
RSAPem = RSAKeyGen.private_bytes(
    encoding=serialization.Encoding.PEM,
    format=serialization.PrivateFormat.PKCS8,
    encryption_algorithm=serialization.NoEncryption())
with open("./serverKey.pem", "wb") as f:
    f.write(RSAPem)

Should be usable and not raise SSHException("'not a valid RSA private key file'") while loading the RSA key by paramiko RSAKey class

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the RSAKey loading path used by the Transport class and compare its handling of the PKCS#1 key with the PKCS8 example in the issue. Verify the change by loading the generated RSA private key through RSAKey without raising SSHException.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.