github.com/nats-io/nsc@v0.0.0-20221206222106-35db9400b257/docs/nsc_export_keys.md (about) 1 ## nsc export keys 2 3 Export operator, account and user keys in the current operator and account context 4 5 ### Synopsis 6 7 Export operator, account and user keys in the current operator and account context. 8 Additional flags allow you to specify which types of keys to export. For example 9 the --operator flag exports any operator keys, --accounts exports account keys, etc. 10 11 To export all key types specify the --all flag. 12 13 14 You can limit export to a different account context by specifying --account flag. 15 You can limit exporting user keys to the specified user by specifying the --user flag. 16 17 The --not-referenced flag exports all keys not relevant to the current operator, 18 accounts and users. These keys may be referenced in a different operator context. 19 20 The --filter flag allows you to specify a few letters in a public key and export only 21 those keys that matching the filter (provided the key type matches --operator, --account, 22 --user (or --all). 23 24 25 ``` 26 nsc export keys [flags] 27 ``` 28 29 ### Examples 30 31 ``` 32 nsc export keys --dir <path> (exports the current operator, account and users keys) 33 nsc export keys --operator --accounts --users (exports current operators, all accounts, and users) 34 nsc export keys --all (same as specifying --operator --accounts --users) 35 nsc export keys --operator --not-referenced (exports any other operator keys in the keystore) 36 nsc export keys --all --filter VSVMGA (exports all keys containing the filter) 37 nsc export keys --account <name> (changes the account context to the specified account) 38 39 ``` 40 41 ### Options 42 43 ``` 44 --account string change account context to the named account 45 -a, --accounts export account keys 46 -A, --all export operator, accounts and users keys 47 -d, --dir string directory to export keys to 48 -f, --filter string export keys containing string 49 -F, --force overwrite existing files 50 -h, --help help for keys 51 --not-referenced export keys that are not referenced in the current operator context 52 -o, --operator export operator keys 53 -R, --remove removes the original key file from the keyring after exporting it 54 --user string export specified user key 55 -u, --users export user keys 56 ``` 57 58 ### Options inherited from parent commands 59 60 ``` 61 --config-dir string nsc config directory 62 --data-dir string nsc data store directory 63 -i, --interactive ask questions for various settings 64 --keystore-dir string nsc keystore directory 65 -K, --private-key string Key used to sign. Can be specified as role (where applicable), 66 public key (private portion is retrieved) 67 or file path to a private key or private key 68 ``` 69 70 ### SEE ALSO 71 72 * [nsc export](nsc_export.md) - Export assets such as nkeys 73 74 ###### Auto generated by spf13/cobra on 25-Feb-2022