Add certificate subcommands, key delete, and ctk command for macOS#316
Add certificate subcommands, key delete, and ctk command for macOS#316
Conversation
- Add certificate copy and delete subcommands - Add key delete subcommand - Add ctk command (macOS/CGO) to list CryptoTokenKit identities with table, JSON, and PEM output modes, token filtering, and serial lookup - Update certificate and key command descriptions to reflect new capabilities - Update copyright year to 2022-2026 across all files
| Short: "copy a certificate into a KMS", | ||
| Long: `Copies a certificate into a KMS from a PEM file or another KMS URI.`, |
There was a problem hiding this comment.
It copies multiple certs when the source has multiple certs.
Making it a "certificate chain" isn't entirely correct (although that's the method that's being used on the KMS), as there's no check that it's an actual (partial) chain. Maybe "certificate (bundle)" works, but could be confusing in combination with the --bundle flag. Or do a check if it's an actual chain before storing (I don't believe we do that in each KMS, but maybe we should?), and then use "certificate (chain)".
It's possible that a source has multiple certs, and the destination doesn't support storing multiple. Right now that would result in only the first cert being stored, without the user getting to know that fact. This might be OK, but maybe we should print something indicating this case?
| type jsonEntry struct { | ||
| Subject string `json:"subject"` | ||
| Serial string `json:"serial"` | ||
| NotBefore string `json:"not_before"` | ||
| NotAfter string `json:"not_after"` | ||
| Token string `json:"token"` | ||
| KeyType string `json:"key_type"` | ||
| KeySize int `json:"key_size"` | ||
| } | ||
| out := make([]jsonEntry, len(entries)) |
There was a problem hiding this comment.
Doesn't the ctkEntry work for marshaling?
Description
This PR adds the following changes:
I had an old delete command and a simple ctk command but I've used claude code to improve them.