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

Setting Trust Level of Installed Keys #14

Open
rbroemeling opened this issue Nov 12, 2015 · 3 comments
Open

Setting Trust Level of Installed Keys #14

rbroemeling opened this issue Nov 12, 2015 · 3 comments
Labels

Comments

@rbroemeling
Copy link

Hi,

There doesn't appear to be any way to set the trust level of installed keys when using this module to add gnupg keys. This can be necessary if, for example, gpg public keys are being installed which are going to be used to encrypt files (in which case, gpg likes the public keys involved to be trusted).

Could we adapt the module to allow setting of trust levels via a parameter to the gnupg_key type?

Something like:

  gnupg_key {
    'mykey - public':
      ensure      => present,
      key_id      => 'a2b4c6f8',
      user        => 'root',
      key_content => "-----BEGIN PGP PUBLIC KEY BLOCK-----
      ...
-----END PGP PUBLIC KEY BLOCK-----",
      key_trust   => 6,
      key_type    => public;
}

The --import-ownertrust gpg command could be used, to this end.

Ref: https://www.gnupg.org/documentation/manuals/gnupg/Operational-GPG-Commands.html#option-_002d_002dexport_002downertrust

@dgolja dgolja added the feature label Nov 13, 2015
@dgolja
Copy link
Owner

dgolja commented Nov 13, 2015

Sure we can add this parameter. I can have a look in the next week or if you have time you can create a PR.

@rbroemeling
Copy link
Author

@n1tr0g I did some initial work on it, have attached a PR. I have not fully tested it, I just wanted to get some progress and see what you thought of the approach.

There are no tests (should we add some?) and there is no verification that an existing key is set to the right trust level (I'm not sure how to approach that). Trust level is just set on initial key addition.

@rbroemeling
Copy link
Author

@dgolja Any update on this?

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

No branches or pull requests

2 participants