gaborcsardi / secret

:closed_lock_with_key: Secure sharing of sensitive information in R packages
Other
102 stars 16 forks source link

Match private key to user with fingerprint #18

Closed jiwalker-usgs closed 7 years ago

jiwalker-usgs commented 7 years ago

Not sure if you have a suggestion label, but instead of looping over the users .enc files until one works, the user "name" or email could be matched by checking the fingerprints of the key and the users public key fingerprints. Something like:

for (pubkey in dir('vault/users/' pattern='.pem$')) {
  pubkeyfile = file.path('inst', 'vault', 'users', pubkey)
  if (as.character(fingerprint(key)) == as.character(fingerprint(read_pubkey(pubkeyfile)))) {
    return(pubkey)
  }
}
gaborcsardi commented 7 years ago

Good idea. Want to submit a PR? :)

jiwalker-usgs commented 7 years ago

Yeah, I should be able to get to that soon.

jordansread commented 5 years ago

Can the version number be changed to reflect this addition? Looks like GH version is 1.0.0, which is the same as CRAN.

gaborcsardi commented 5 years ago

@jread-usgs Done in https://github.com/gaborcsardi/secret/commit/63145cf2ee0f396071d7e3abdc1d6e0ace4f029f