kubeedge / kubeedge

Kubernetes Native Edge Computing Framework (project under CNCF)
https://kubeedge.io
Apache License 2.0
6.52k stars 1.68k forks source link

Support parse PKCS8 private key #5600

Open biningo opened 1 month ago

biningo commented 1 month ago

What type of PR is this? /kind feature

What this PR does / why we need it: PKCS8 private key cannot be parsed

Which issue(s) this PR fixes:

Fixes #5599

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

kubeedge-bot commented 1 month ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign zc2638 after the PR has been reviewed. You can assign the PR to them by writing /assign @zc2638 in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[cloud/pkg/cloudhub/OWNERS](https://github.com/kubeedge/kubeedge/blob/master/cloud/pkg/cloudhub/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
kubeedge-bot commented 1 month ago

Welcome @biningo! It looks like this is your first PR to kubeedge/kubeedge 🎉

biningo commented 1 month ago

Can you explain in detail under what circumstances you need to parse other types of private keys? If we use ECPrivateKey by default, seems we don't need to parse other types?

Hi @wbc6080
If the CA certificate does not exist in the cloud, cloudcore will automatically generate the CA private key and CA certificate. As you said, the auto-generated private key is EC format.

KubeEdge supports users to generate CA private key and CA certificate by themselves, if users use PKCS1 format or PKCS8 format private key, it will fail to parse. https://github.com/kubeedge/kubeedge/blob/58bf767f8b763f9e77cf237b9488adfcc8b601be/cloud/pkg/cloudhub/servers/httpserver/server.go#L265-L301