File: change_passphrase.go

package info (click to toggle)
golang-github-theupdateframework-go-tuf 2.0.2%2B0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,908 kB
  • sloc: python: 164; makefile: 89; sh: 37
file content (22 lines) | stat: -rw-r--r-- 558 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package main

import (
	"github.com/flynn/go-docopt"
	"github.com/theupdateframework/go-tuf"
)

func init() {
	register("change-passphrase", cmdChangePassphrase, `
usage: tuf change-passphrase <role>

Changes the passphrase for given role keys file.

Alternatively, passphrases can be passed via environment variables in the
form of TUF_{{ROLE}}_PASSPHRASE for existing ones and
TUF_NEW_{{ROLE}}_PASSPHRASE for setting new ones.
`)
}

func cmdChangePassphrase(args *docopt.Args, repo *tuf.Repo) error {
	return repo.ChangePassphrase(args.String["<role>"])
}