Skip to content

Add pelican key create command#2380

Merged
jhiemstrawisc merged 6 commits into
PelicanPlatform:mainfrom
h2zh:pelican-key-create
Jun 18, 2025
Merged

Add pelican key create command#2380
jhiemstrawisc merged 6 commits into
PelicanPlatform:mainfrom
h2zh:pelican-key-create

Conversation

@h2zh

@h2zh h2zh commented Jun 9, 2025

Copy link
Copy Markdown
Contributor

What this new command does is identical to pelican generate keygen command - create a pair of private/public keys. The only difference is the new private key file will be named as "issuer.pem" instead of "issuer.jwk". The new extension reflects the real format (PEM, Privacy-Enhanced Mail) of this private key file and is required by Pelican to automatically detect it in the IssuerKeysDirectory.

There is no backward compatibility issue for this change because it won't affect the existing "issuer.jwk" file (which still work via the IssuerKey config param). I also updated the Pelican docs to let facilitators and users know this change. (See #2150 )

pelican generate keygen is planned to retire it in the future. For now, it remains available for backward compatibility.

Closes #2192

h2zh added 2 commits June 3, 2025 17:01
- What this command does is identical to `pelican generate keygen` command, which is planned to retire it in the future.
- ".pem" is the correct format (PEM, Privacy-Enhanced Mail) for private keys generated by Pelican
@h2zh h2zh added this to the v7.17 milestone Jun 9, 2025
@h2zh h2zh added client Issue affecting the OSDF client Facilitation A request from the RCF's labels Jun 9, 2025
@jhiemstrawisc jhiemstrawisc self-requested a review June 9, 2025 17:18

@jhiemstrawisc jhiemstrawisc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One other question I have is how hard it would be to tweak the default behavior of this command such that if you provide a path to an existing private key, the command:

  1. Warns you there's an existing file there and that it's being used instead of being overwritten
  2. Tries to use the existing private key to generate the public key

This would be very beneficial in cases where someone needs to get a public key from the private key. Otherwise they need to jump through a bunch of hoops just to set up an Origin and they have to know about the special /.well-known/openid-configuration web path. That's asking a lot of users.

Comment thread cmd/key.go Outdated
Comment thread cmd/key.go Outdated
Comment thread cmd/key.go Outdated
@h2zh h2zh modified the milestones: v7.17, v7.18 Jun 16, 2025
h2zh added 3 commits June 17, 2025 16:53
- Rename the default private key filename to `private-key.pem`
- Improve description
- If the private key file exists, it now warns the user and uses the existing key to generate the public key, instead of failing.
- The public key file will still not be overwritten if it already exists.
- If the private key does not exist, it is generated as before.
…mand

- Rename the source code file name to migrate to the `pelican key create` command
@h2zh h2zh requested a review from jhiemstrawisc June 17, 2025 18:37
Comment thread cmd/key.go Outdated
Comment thread cmd/key.go Outdated
@jhiemstrawisc jhiemstrawisc self-requested a review June 18, 2025 20:30

@jhiemstrawisc jhiemstrawisc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@jhiemstrawisc jhiemstrawisc merged commit e658c46 into PelicanPlatform:main Jun 18, 2025
25 of 26 checks passed
@h2zh h2zh modified the milestones: v7.18, v7.17 Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client Issue affecting the OSDF client Facilitation A request from the RCF's

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New Pelican CLI command: pelican key create

2 participants