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

Write private key in accordance with Asymmetric Key Packages RFC #144

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

iron-s
Copy link
Contributor

@iron-s iron-s commented Mar 11, 2024

The key is marshaled using MarshalPKCS8PrivateKey which suggests the "PRIVATE KEY" PEM block type, and Asymmetric Key Packages RFC states:

When .p8 files are PEM encoded they use the .pem file extension. PEM encoding is ... Base64 encoding, see Section 4 of [RFC4648], of the DER-encoded PrivateKeyInfo sandwiched between:
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----

Closes #87

The key is marshaled using [MarshalPKCS8PrivateKey](https://pkg.go.dev/crypto/x509#MarshalPKCS8PrivateKey) which suggests the "PRIVATE KEY" PEM block type, and [Asymmetric Key Packages RFC](https://datatracker.ietf.org/doc/html/rfc5958) states:
> When .p8 files are PEM encoded they use the .pem file extension. PEM encoding is ... Base64 encoding, see Section 4 of [RFC4648], of the DER-encoded PrivateKeyInfo sandwiched between:
>   -----BEGIN PRIVATE KEY-----
>   -----END PRIVATE KEY-----

Signed-off-by: Aliaksei Shainiuk <alexey.sheynuk@gmail.com>
Copy link
Collaborator

@faisal-memon faisal-memon left a comment

Choose a reason for hiding this comment

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

Thanks @iron-s for this submission.

@faisal-memon faisal-memon merged commit 95b0e53 into spiffe:main Mar 13, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Workload RSA Private Key
2 participants