Skip to content

SSH comment parameter #15484

Description

@DoctorD90

Currently there is no opportunity for SSH format to add a comment like for the "corresponding" openSSH command:
ssh-keygen -t ed25519 -C "user@example.com" -N "MySecretPassword" -f id_ed25519_key

In the current version an SSH key is generated like that:

key_bytes = key.private_bytes(
    encoding=serialization.Encoding.PEM,
    format=serialization.PrivateFormat.OpenSSH,
    encryption_algorithm=serialization.BestAvailableEncryption("MySecretPassword".encode('utf-8')),
)

but there is no ssh_comment parameter to be used to add the "user@example.com" to the private key.

Ok, it is there a work around for the PUBLIC key appending the comment, but with SSH format is possible to "embed" the comment inside the private key directly.

Would be possible to implement that feature in the library?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions