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

New interface for PKCS8 key encryption #4593

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

randombit
Copy link
Owner

Quite a few interfaces exist for this but there really are only two things that change between them: if the PBKDF runtime is specified in "iterations" or in a duration, and if the result is PEM encoded or not.

Add a new single interface for PKCS8 encryption, PKCS8::encrypt_private_key, then define all of the previously existing functions in terms of that.

@randombit randombit added this to the Botan 3.8.0 milestone Jan 25, 2025
@randombit randombit requested a review from reneme January 25, 2025 16:27
@randombit
Copy link
Owner Author

Some things to work out

  • Best name for EncryptedPrivateKey. Perhaps reflecting the PKCS8 structure name?
  • Should we take the opportunity to move this to Private_Key

@coveralls
Copy link

coveralls commented Jan 25, 2025

Coverage Status

coverage: 91.224% (-0.003%) from 91.227%
when pulling 212e628 on jack/pkcs8-enc
into 79027d2 on master.

@randombit randombit force-pushed the jack/pkcs8-enc branch 2 times, most recently from 34c7c9f to 212e628 Compare January 25, 2025 23:33
Quite a few interfaces exist for this but there really are only two
things that change between them: if the PBKDF runtime is specified in
"iterations" or in a duration, and if the result is PEM encoded or not.

Add a new single interface for PKCS8 encryption, PKCS8::encrypt_private_key,
then define all of the previously existing functions in terms of that.
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.

2 participants