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

Is it possible to add a key to the Certificate Authority? #57

Open
DeepZeepOk opened this issue Mar 7, 2023 · 3 comments
Open

Is it possible to add a key to the Certificate Authority? #57

DeepZeepOk opened this issue Mar 7, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@DeepZeepOk
Copy link

If not, is there any plan to add this feature?

@opoplawski
Copy link
Contributor

I don't have a need for it so it's not high on my priority list. PRs are welcome though.

@opoplawski opoplawski added the enhancement New feature or request label Dec 23, 2023
@opoplawski
Copy link
Contributor

Are you looking for the equivalent of the "create internal CA" web configuration, or something different?

@OtterHacker
Copy link

OtterHacker commented Jul 14, 2024

If this is related to the possibility to import a CA with a private key, it can be simply implemented :
In _validate_params

if params['key'] is not None:
      ca_key = params['key']
      lines = ca_key.splitlines()
      if lines[0] == '-----BEGIN PRIVATE KEY-----' and lines[-1] == '-----END PRIVATE KEY-----':
          params['key'] = base64.b64encode(ca_key.encode()).decode()
      elif not re.match('LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0t', ca_key):
          self.module.fail_json(msg='Could not recognize CA key format: %s' % (ca_key))

And in _params_to_obj:

if 'key' in params and params['key'] is not None:
      obj['prv'] = params['key']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants