| 1 |
.TH pkcstok_admin 1 "July 2024" "@PACKAGE_VERSION@" "openCryptoki" |
| 2 |
.SH NAME |
| 3 |
pkcstok_admin \- utility to administrate token directories of the Opencryptoki |
| 4 |
token repository. |
| 5 |
. |
| 6 |
. |
| 7 |
. |
| 8 |
.SH SYNOPSIS |
| 9 |
. |
| 10 |
.B pkcstok_admin |
| 11 |
.I command |
| 12 |
.RB [ OPTIONS ] |
| 13 |
.PP |
| 14 |
. |
| 15 |
.B pkcstok_admin |
| 16 |
.BR \-\-help | \-h |
| 17 |
.br |
| 18 |
.B pkcstok_admin |
| 19 |
.BR \-\-version | \-v |
| 20 |
. |
| 21 |
. |
| 22 |
. |
| 23 |
.SH DESCRIPTION |
| 24 |
. |
| 25 |
The \fBpkcstok_admin\fP utility can be used to administrate token directories of |
| 26 |
the Opencryptoki token repository with proper permissions and owners. |
| 27 |
By default token directories are owned by the \fB@pkcs_group@\fP group, and |
| 28 |
every user that is a member of the \fB@pkcs_group@\fP group has access to the |
| 29 |
token and its token objects (i.e. keys, certificates, etc.). |
| 30 |
.PP |
| 31 |
A token directory can alternatively be owned by a token specific group. |
| 32 |
Specify the group name with keyword \fBusergroup\fP in the slot definition in |
| 33 |
the \fBopencryptoki.conf\fP configuration file located in |
| 34 |
\fB@sysconfdir@/opencryptoki/\fP. |
| 35 |
With that, only users that are members of the configured token specific group |
| 36 |
have access to the token and its token objects. Users that are only members of |
| 37 |
the \fB@pkcs_group@\fP group, but are not also members of the token specific |
| 38 |
group do not have access to the token. Users of the token specific group must |
| 39 |
still also be members of the \fB@pkcs_group@\fP group to be able to use |
| 40 |
Opencryptoki. |
| 41 |
.PP |
| 42 |
Token specific files are usually stored in |
| 43 |
\fB@localstatedir@/lib/opencryptoki/<token-name>/\fP. Additionally token |
| 44 |
specific lock files are stored in |
| 45 |
\fB@localstatedir@/lock/opencryptoki/<token-name>/\fP. |
| 46 |
Furthermore, a token specific POSIX shared memory segment exists under |
| 47 |
\fB/dev/shm/\fP. All files and directories within these token specific |
| 48 |
directories as well as the shared memory segment are owned by the token |
| 49 |
specific group, or by the \fB@pkcs_group@\fP group if no token specific group |
| 50 |
has been configured. |
| 51 |
.PP |
| 52 |
The \fBpkcstok_admin\fP utility must be run as \fBroot\fP, and the |
| 53 |
\fBpkcsslotd\fP must be stopped before running this utility. |
| 54 |
.PP |
| 55 |
.PP |
| 56 |
.B Note: |
| 57 |
Do not use the \fBpkcstok_admin\fP utility on a \fBTPM token\fP. The |
| 58 |
\fBTPM token\fP uses a different directory structure, and stores token objects |
| 59 |
on a per user basis. The \fBpkcstok_admin\fP utility is not capable of setting |
| 60 |
the owners correctly on such a directory structure. Furthermore, the |
| 61 |
\fBTPM token\fP is deprecated, because it supports only TPM version 1.2. |
| 62 |
It does not work with TPM version 2.0. |
| 63 |
. |
| 64 |
. |
| 65 |
. |
| 66 |
.SH COMMANDS |
| 67 |
. |
| 68 |
The \fBpkcstok_admin\fP tool supports various commands to administrate token |
| 69 |
directories. |
| 70 |
.PP |
| 71 |
.SS "Creating a new token and its directories" |
| 72 |
.B pkcstok_admin |
| 73 |
.B create |
| 74 |
.BR \-\-token | \-t |
| 75 |
.I TOKNAME |
| 76 |
.RB [ \-\-group | \-g |
| 77 |
.IR GROUP ] |
| 78 |
.RB [ \-\-force ] |
| 79 |
.RB [ \-\-verbose ] |
| 80 |
.PP |
| 81 |
Use the \fBcreate\fP command to create a new token and its directories. |
| 82 |
.PP |
| 83 |
Use the |
| 84 |
.BR \-\-token | \-t |
| 85 |
.I TOKNAME |
| 86 |
option to specify the name of the token to create. The token name must also be |
| 87 |
specified in the slot definition in the \fBopencryptoki.conf\fP configuration |
| 88 |
file located in \fB@sysconfdir@/opencryptoki/\fP with keyword \fBtokname\fP. |
| 89 |
.PP |
| 90 |
Use the |
| 91 |
.RB [ \-\-group | \-g |
| 92 |
.IR GROUP ] |
| 93 |
option to specify the token specific user group used as group owner of the |
| 94 |
token directories. If no group is specified, the token directories will be owned |
| 95 |
by the \fB@pkcs_group@\fP group. If a group is specified, then it must also be |
| 96 |
specified in the slot definition in the \fBopencryptoki.conf\fP configuration |
| 97 |
file located in \fB@sysconfdir@/opencryptoki/\fP with keyword \fBusergroup\fP. |
| 98 |
.PP |
| 99 |
The \fBpkcstok_admin\fP tool prompts for a confirmation before the token |
| 100 |
directories are created. To omit the prompt, specify the |
| 101 |
.B \-\-force |
| 102 |
option. Use this option with care! |
| 103 |
.PP |
| 104 |
Specify the |
| 105 |
.B \-\-verbose |
| 106 |
option to see more detailed messages about the actions the tool is performing. |
| 107 |
. |
| 108 |
. |
| 109 |
. |
| 110 |
.PP |
| 111 |
.SS "Changing the owner of an existing token and its directories" |
| 112 |
.B pkcstok_admin |
| 113 |
.B chown |
| 114 |
.BR \-\-token | \-t |
| 115 |
.I TOKNAME |
| 116 |
.RB [ \-\-group | \-g |
| 117 |
.IR GROUP ] |
| 118 |
.RB [ \-\-force ] |
| 119 |
.RB [ \-\-verbose ] |
| 120 |
.PP |
| 121 |
Use the \fBchown\fP command to change the owner of an existing token and its |
| 122 |
directories. |
| 123 |
.PP |
| 124 |
Use the |
| 125 |
.BR \-\-token | \-t |
| 126 |
.I TOKNAME |
| 127 |
option to specify the name of the token to change the owner for. The token name |
| 128 |
is usually specified in the slot definition in the \fBopencryptoki.conf\fP |
| 129 |
configuration file located in \fB@sysconfdir@/opencryptoki/\fP with keyword |
| 130 |
\fBtokname\fP. |
| 131 |
If the slot definition does not specify a \fBtokname\fP keyword, then a |
| 132 |
default token name is used, dependent on the token model. The \fBICA token\fP |
| 133 |
uses \fBlite\fP as default token name, the \fBCCA token\fP uses \fBccatok\fP, |
| 134 |
the \fBSoft token\fP uses \fBswtok\fP, the \fBEP11 token\fP uses \fBep11tok\fP, |
| 135 |
the \fBICSF token\fP uses \fBicsf\fP, and the \fBTPM token\fP (deprecated) uses |
| 136 |
\fBtpm\fP. |
| 137 |
.PP |
| 138 |
Use the |
| 139 |
.RB [ \-\-group | \-g |
| 140 |
.IR GROUP ] |
| 141 |
option to specify the token specific user group to set as group owner of the |
| 142 |
token directories. If no group is specified, the token directories will be |
| 143 |
changed to be owned by the \fB@pkcs_group@\fP group. If a group is specified, |
| 144 |
then it must also be specified in the slot definition in the |
| 145 |
\fBopencryptoki.conf\fP configuration file located in |
| 146 |
\fB@sysconfdir@/opencryptoki/\fP with keyword \fBusergroup\fP. If no group is |
| 147 |
specified, then remove the \fBusergroup\fP keyword from the slot definition, or |
| 148 |
change its value to \fB@pkcs_group@\fP. |
| 149 |
.PP |
| 150 |
The \fBpkcstok_admin\fP tool prompts for a confirmation before the owner of the |
| 151 |
token directories is changed. To omit the prompt, specify the |
| 152 |
.B \-\-force |
| 153 |
option. Use this option with care! |
| 154 |
.PP |
| 155 |
Specify the |
| 156 |
.B \-\-verbose |
| 157 |
option to see more detailed messages about the actions the tool is performing. |
| 158 |
. |
| 159 |
. |
| 160 |
. |
| 161 |
.PP |
| 162 |
.SS "Removing an existing token and its directories" |
| 163 |
.B pkcstok_admin |
| 164 |
.B remove |
| 165 |
.BR \-\-token | \-t |
| 166 |
.I TOKNAME |
| 167 |
.RB [ \-\-force ] |
| 168 |
.RB [ \-\-verbose ] |
| 169 |
.PP |
| 170 |
Use the \fBremove\fP command to remove an existing token and its directories. |
| 171 |
This also removes all token objects of that token. Use with care! |
| 172 |
|
| 173 |
.PP |
| 174 |
Use the |
| 175 |
.BR \-\-token | \-t |
| 176 |
.I TOKNAME |
| 177 |
option to specify the name of the token to remove. You must also remove the |
| 178 |
corresponding slot definition from the \fBopencryptoki.conf\fP configuration |
| 179 |
file located in \fB@sysconfdir@/opencryptoki/\fP. The token name is usually |
| 180 |
specified in the slot definition in the \fBopencryptoki.conf\fP configuration |
| 181 |
file. If the slot definition does not specify a \fBtokname\fP keyword, then a |
| 182 |
default token name is used, dependent on the token model. The \fBICA token\fP |
| 183 |
uses \fBlite\fP as default token name, the \fBCCA token\fP uses \fBccatok\fP, |
| 184 |
the \fBSoft token\fP uses \fBswtok\fP, the \fBEP11 token\fP uses \fBep11tok\fP, |
| 185 |
the \fBICSF token\fP uses \fBicsf\fP, and the \fBTPM token\fP (deprecated) uses |
| 186 |
\fBtpm\fP. |
| 187 |
.PP |
| 188 |
The \fBpkcstok_admin\fP tool prompts for a confirmation before the token |
| 189 |
directories are removed. To omit the prompt, specify the |
| 190 |
.B \-\-force |
| 191 |
option. Use this option with care! |
| 192 |
.PP |
| 193 |
Specify the |
| 194 |
.B \-\-verbose |
| 195 |
option to see more detailed messages about the actions the tool is performing. |
| 196 |
. |
| 197 |
. |
| 198 |
. |
| 199 |
.PP |
| 200 |
.SS "Resetting a token to its initial state" |
| 201 |
.B pkcstok_admin |
| 202 |
.B reset |
| 203 |
.BR \-\-token | \-t |
| 204 |
.I TOKNAME |
| 205 |
.RB [ \-\-force ] |
| 206 |
.RB [ \-\-verbose ] |
| 207 |
.PP |
| 208 |
Use the \fBreset\fP command to reset a token to its initial state. |
| 209 |
This also resets all PINs and removes all token objects. Use with care! |
| 210 |
.PP |
| 211 |
Resetting a token can be required if you forgot the SO pin, or the SO pin got |
| 212 |
locked due to too many login attempts using a wrong SO PIN. |
| 213 |
.PP |
| 214 |
Use the |
| 215 |
.BR \-\-token | \-t |
| 216 |
.I TOKNAME |
| 217 |
option to specify the name of the token to reset. The token name |
| 218 |
is usually specified in the slot definition in the \fBopencryptoki.conf\fP |
| 219 |
configuration file located in \fB@sysconfdir@/opencryptoki/\fP with keyword |
| 220 |
\fBtokname\fP. |
| 221 |
If the slot definition does not specify a \fBtokname\fP keyword, then a |
| 222 |
default token name is used, dependent on the token model. The \fBICA token\fP |
| 223 |
uses \fBlite\fP as default token name, the \fBCCA token\fP uses \fBccatok\fP, |
| 224 |
the \fBSoft token\fP uses \fBswtok\fP, the \fBEP11 token\fP uses \fBep11tok\fP, |
| 225 |
the \fBICSF token\fP uses \fBicsf\fP, and the \fBTPM token\fP (deprecated) uses |
| 226 |
\fBtpm\fP. |
| 227 |
.PP |
| 228 |
The \fBpkcstok_admin\fP tool prompts for a confirmation before the token |
| 229 |
is resetted. To omit the prompt, specify the |
| 230 |
.B \-\-force |
| 231 |
option. Use this option with care! |
| 232 |
.PP |
| 233 |
Specify the |
| 234 |
.B \-\-verbose |
| 235 |
option to see more detailed messages about the actions the tool is performing. |
| 236 |
.PP |
| 237 |
After resetting a token, it must be initialized freshly using \fBpkcsconf -I\fP, |
| 238 |
setting the SO pin using \fBpkcsconf -P\fP and then initializing the USER pin |
| 239 |
using \fBpkcsconf -u\P. |
| 240 |
. |
| 241 |
. |
| 242 |
. |
| 243 |
.SH OPTIONS |
| 244 |
. |
| 245 |
.TP 8 |
| 246 |
.BR \-\-token | \-t\~\fITOKNAME\fP |
| 247 |
Specifies the name of the token to operate on. The token name must also be |
| 248 |
specified in the slot definition in the \fBopencryptoki.conf\fP configuration |
| 249 |
file located in \fB@sysconfdir@/opencryptoki/\fP with keyword \fBtokname\fP. |
| 250 |
If the slot definition does not specify a \fBtokname\fP keyword, then a |
| 251 |
default token name is used, dependent on the token model. The \fBICA token\fP |
| 252 |
uses \fBlite\fP as default token name, the \fBCCA token\fP uses \fBccatok\fP, |
| 253 |
the \fBSoft token\fP uses \fBswtok\fP, the \fBEP11 token\fP uses \fBep11tok\fP, |
| 254 |
the \fBICSF token\fP uses \fBicsf\fP, and the \fBTPM token\fP (deprecated) uses |
| 255 |
\fBtpm\fP. |
| 256 |
.RE |
| 257 |
.PP |
| 258 |
. |
| 259 |
.TP 8 |
| 260 |
.BR \-\-group | \-g\~\fIGROUP\fP |
| 261 |
Specifies the token specific user group used as group owner of the token |
| 262 |
directories. If this option is omitted, the token directories will be owned |
| 263 |
by the \fB@pkcs_group@\fP group. If a group is specified, then it must also be |
| 264 |
specified in the slot definition in the \fBopencryptoki.conf\fP configuration |
| 265 |
file located in \fB@sysconfdir@/opencryptoki/\fP with keyword \fBusergroup\fP. |
| 266 |
.RE |
| 267 |
.PP |
| 268 |
. |
| 269 |
.TP 8 |
| 270 |
.BR \-\-force | \-f |
| 271 |
The \fBpkcstok_admin\fP tool prompts for a confirmation before the token |
| 272 |
directories are created. To omit the prompt, specify this option. Use this with |
| 273 |
care! |
| 274 |
.RE |
| 275 |
.PP |
| 276 |
. |
| 277 |
.TP 8 |
| 278 |
.BR \-\-verbose | \-V |
| 279 |
Turn on verbose mode to see more detailed messages about the actions the tool |
| 280 |
is performing. |
| 281 |
.RE |
| 282 |
.PP |
| 283 |
. |
| 284 |
.TP 8 |
| 285 |
.BR \-\-help | \-h |
| 286 |
Prints help for the usage of the |
| 287 |
.B pkcstok_admin |
| 288 |
tool and then exits. |
| 289 |
.RE |
| 290 |
.PP |
| 291 |
. |
| 292 |
.TP 8 |
| 293 |
.BR \-\-version | \-v |
| 294 |
Prints the version of the |
| 295 |
.B pkcstok_admin |
| 296 |
tool and then exits. |
| 297 |
.RE |
| 298 |
.PP |
| 299 |
. |
| 300 |
. |
| 301 |
. |
| 302 |
.SH "FILES" |
| 303 |
. |
| 304 |
.SS "@localstatedir@/lib/opencryptoki/<token-name>/" |
| 305 |
Contains the token specific data, like the token's master key encrypted with |
| 306 |
the SO and USER PINs (\fBMK_SO\fP and \fBMK_USER\fP), as well as the non |
| 307 |
volatile token state data (\fBNVTOK.DAT\fP). Subdirectory \fBTOK_OBJ\fP |
| 308 |
contains the token objects and an index file (\fBOBJ.IDX\fP). |
| 309 |
. |
| 310 |
.SS "@localstatedir@/lock/opencryptoki/<token-name>/" |
| 311 |
Contains a token specific lock file (\fBLCK..<tokname>\fP) that is used to |
| 312 |
synchronize access to the token data across multiple processes. |
| 313 |
|
| 314 |
.SS "Token specific POSIX shared memory segment under /dev/shm/" |
| 315 |
Contains token specific shared state data for tracking updates to token objects |
| 316 |
done by processes. Its name is derived from the token specific directory |
| 317 |
under \fB@localstatedir@/lib/opencryptoki/\fP. |
| 318 |
. |
| 319 |
. |
| 320 |
. |
| 321 |
.SH SEE ALSO |
| 322 |
. |
| 323 |
.PD 0 |
| 324 |
\fBopencryptoki.conf\fP(5). |
| 325 |
.PD |