Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow step certificate p12 to specify a friendly name/alias #1183

Open
sshipway opened this issue May 27, 2024 · 2 comments
Open

Allow step certificate p12 to specify a friendly name/alias #1183

sshipway opened this issue May 27, 2024 · 2 comments
Assignees
Labels
enhancement needs triage Waiting for discussion / prioritization by team

Comments

@sshipway
Copy link

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

When you create a PKCS12 file from a cert/key pair, the new P12 file has the item with the alias '1'. It would be helpful to be able to specify a different alias, such as:

step certificate p12 foo.p12 foo.crt foo.key --alias foo.com

Why is this needed?

When managing keystores, some applications expect the cert/key to be referenced by the FQDN. Similarly, if you are using keytool to import the pkcs12 file into a JKS, it will try to replicate the items based on the alias. This can be overridden on the commandline, but it would be more convenient if the pkcs12 file could be created with the alias in the first place - this also removes another step from any postdeploy process.

@sshipway sshipway added enhancement needs triage Waiting for discussion / prioritization by team labels May 27, 2024
@sshipway
Copy link
Author

This is the command I use for importing a smallstep-generated cert without alias into a JKS:

keytool -importkeystore -srckeystore cert.p12 -srcstoretype PKCS12 \
  -destkeystore keystore  \
  -destalias foo.smxemail.com -srcalias 1

If we were able to specify the alias at creation time, I would not need to specify -destalias and -srcalias

@hslatman
Copy link
Member

hslatman commented May 28, 2024

Hey @sshipway, it's surprising to see the alias is 1. IIRC it should be a concatenation of subject and the certificate fingerprint: https://github.com/smallstep/cli/blob/master/command/certificate/p12.go#L180. looks like it goes through this path, which doesn't seem to set a friendly name when it's just a cert + key: https://github.com/smallstep/cli/blob/master/command/certificate/p12.go#L153-L173.

That said, this looks to be a (partial) duplicate of #1004.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

No branches or pull requests

3 participants