JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
man pages section 1: User Commands     Oracle Solaris 10 8/11 Information Library
search filter icon
search icon

Document Information

Preface

Introduction

User Commands

acctcom(1)

adb(1)

addbib(1)

admin(1)

aedplot(1B)

alias(1)

allocate(1)

amt(1)

appcert(1)

apptrace(1)

apropos(1)

ar(1)

arch(1)

as(1)

asa(1)

at(1)

atoplot(1B)

atq(1)

atrm(1)

audioconvert(1)

audioplay(1)

audiorecord(1)

auths(1)

auto_ef(1)

awk(1)

banner(1)

basename(1)

basename(1B)

batch(1)

bc(1)

bdiff(1)

bfs(1)

bg(1)

bgplot(1B)

biff(1B)

break(1)

cal(1)

calendar(1)

cancel(1)

case(1)

cat(1)

cc(1B)

cd(1)

cdc(1)

cdrw(1)

chdir(1)

checkeq(1)

checknr(1)

chgrp(1)

chkey(1)

chmod(1)

chown(1)

chown(1B)

ckdate(1)

ckgid(1)

ckint(1)

ckitem(1)

ckkeywd(1)

ckpath(1)

ckrange(1)

ckstr(1)

cksum(1)

cktime(1)

ckuid(1)

ckyorn(1)

clear(1)

cmp(1)

cocheck(1F)

cocreate(1F)

codestroy(1F)

col(1)

comb(1)

comm(1)

command(1)

compress(1)

continue(1)

coproc(1F)

coreceive(1F)

cosend(1F)

cp(1)

cpio(1)

cpp(1)

cputrack(1)

crle(1)

crontab(1)

crtplot(1B)

crypt(1)

csh(1)

csplit(1)

ct(1C)

ctags(1)

ctrun(1)

ctstat(1)

ctwatch(1)

cu(1C)

cut(1)

date(1)

dc(1)

deallocate(1)

decrypt(1)

delta(1)

deroff(1)

df(1B)

dhcpinfo(1)

diff(1)

diff3(1)

diffmk(1)

digest(1)

digestp(1)

dircmp(1)

dirname(1)

dirs(1)

dis(1)

disable(1)

dispgid(1)

dispuid(1)

dos2unix(1)

download(1)

dpost(1)

dtappsession(1)

du(1)

du(1B)

dumbplot(1B)

dump(1)

dumpcs(1)

dumpkeys(1)

echo(1)

echo(1B)

echo(1F)

ed(1)

edit(1)

egrep(1)

eject(1)

elfdump(1)

elfedit(1)

elfsign(1)

elfwrap(1)

enable(1)

encrypt(1)

enhance(1)

env(1)

eqn(1)

errange(1)

errdate(1)

errgid(1)

errint(1)

erritem(1)

error(1)

errpath(1)

errstr(1)

errtime(1)

erruid(1)

erryorn(1)

eval(1)

ex(1)

exec(1)

exit(1)

expand(1)

export(1)

exportfs(1B)

expr(1)

expr(1B)

exstr(1)

face(1)

factor(1)

false(1)

fastboot(1B)

fasthalt(1B)

fc(1)

fdformat(1)

fg(1)

fgrep(1)

file(1)

file(1B)

filep(1)

filesync(1)

filofaxp(1)

find(1)

finger(1)

fmlcut(1F)

fmlexpr(1F)

fmlgrep(1F)

fmli(1)

fmt(1)

fmtmsg(1)

fold(1)

for(1)

foreach(1)

franklinp(1)

from(1B)

ftp(1)

ftpcount(1)

ftpwho(1)

function(1)

gcore(1)

gencat(1)

geniconvtbl(1)

genlayouttbl(1)

genmsg(1)

get(1)

getconf(1)

getfacl(1)

getfrm(1F)

getitems(1F)

getlabel(1)

getopt(1)

getoptcvt(1)

getopts(1)

gettext(1)

gettxt(1)

getzonepath(1)

gigiplot(1B)

glob(1)

goto(1)

gprof(1)

graph(1)

grep(1)

groups(1)

groups(1B)

grpck(1B)

hash(1)

hashcheck(1)

hashmake(1)

hashstat(1)

head(1)

help(1)

helpdate(1)

helpgid(1)

helpint(1)

helpitem(1)

helppath(1)

helprange(1)

helpstr(1)

helptime(1)

helpuid(1)

helpyorn(1)

history(1)

hostid(1)

hostname(1)

hp7221plot(1B)

hpplot(1B)

i286(1)

i386(1)

i486(1)

i860(1)

iAPX286(1)

iconv(1)

idnconv(1)

if(1)

implot(1B)

indicator(1F)

indxbib(1)

install(1B)

ipcrm(1)

ipcs(1)

isainfo(1)

isalist(1)

jobs(1)

join(1)

jsh(1)

kbd(1)

kdestroy(1)

keylogin(1)

keylogout(1)

kill(1)

kinit(1)

klist(1)

kmdb(1)

kmfcfg(1)

kpasswd(1)

krb5-config(1)

ksh(1)

ktutil(1)

lari(1)

last(1)

lastcomm(1)

ld(1)

ld(1B)

ldap(1)

ldapadd(1)

ldapdelete(1)

ldaplist(1)

ldapmodify(1)

ldapmodrdn(1)

ldapsearch(1)

ldd(1)

ld.so.1(1)

let(1)

lex(1)

limit(1)

line(1)

lint(1B)

list_devices(1)

listusers(1)

llc2_autoconfig(1)

llc2_config(1)

llc2_stats(1)

ln(1)

ln(1B)

loadkeys(1)

locale(1)

localedef(1)

logger(1)

logger(1B)

login(1)

logname(1)

logout(1)

longline(1F)

look(1)

lookbib(1)

lorder(1)

lp(1)

lpc(1B)

lpq(1B)

lpr(1B)

lprm(1B)

lpstat(1)

lptest(1B)

ls(1)

ls(1B)

m4(1)

mac(1)

mach(1)

machid(1)

madv.so.1(1)

mail(1)

Mail(1B)

mail(1B)

mailcompat(1)

mailp(1)

mailq(1)

mailstats(1)

mailx(1)

make(1S)

man(1)

mconnect(1)

mcs(1)

mdb(1)

mesg(1)

message(1F)

mixerctl(1)

mkdir(1)

mkmsgs(1)

mkstr(1B)

mktemp(1)

moe(1)

more(1)

mp(1)

mpss.so.1(1)

msgfmt(1)

mt(1)

mv(1)

nawk(1)

nca(1)

ncab2clf(1)

ncakmod(1)

neqn(1)

newform(1)

newgrp(1)

news(1)

newsp(1)

newtask(1)

nice(1)

NIS+(1)

nis+(1)

nis(1)

niscat(1)

nischgrp(1)

nischmod(1)

nischown(1)

nischttl(1)

nisdefaults(1)

niserror(1)

nisgrep(1)

nisgrpadm(1)

nisln(1)

nisls(1)

nismatch(1)

nismkdir(1)

nisopaccess(1)

nispasswd(1)

nisrm(1)

nisrmdir(1)

nistbladm(1)

nistest(1)

nl(1)

nm(1)

nohup(1)

notify(1)

nroff(1)

od(1)

on(1)

onintr(1)

optisa(1)

pack(1)

page(1)

pagesize(1)

pargs(1)

passwd(1)

paste(1)

patch(1)

pathchk(1)

pathconv(1F)

pax(1)

pcat(1)

pcred(1)

pdp11(1)

perl(1)

pfcsh(1)

pfexec(1)

pfiles(1)

pfksh(1)

pflags(1)

pfsh(1)

pg(1)

pgrep(1)

pkginfo(1)

pkgmk(1)

pkgparam(1)

pkgproto(1)

pkgtrans(1)

pkill(1)

pktool(1)

plabel(1)

pldd(1)

plimit(1)

plot(1B)

plottoa(1B)

pmap(1)

popd(1)

postdaisy(1)

postdmd(1)

postio(1)

postmd(1)

postplot(1)

postprint(1)

postreverse(1)

posttek(1)

ppgsz(1)

ppriv(1)

pr(1)

praliases(1)

prctl(1)

preap(1)

prex(1)

print(1)

printenv(1B)

printf(1)

priocntl(1)

proc(1)

prof(1)

profiles(1)

projects(1)

prs(1)

prt(1)

prun(1)

ps(1)

ps(1B)

psig(1)

pstack(1)

pstop(1)

ptime(1)

ptree(1)

pushd(1)

pvs(1)

pwait(1)

pwd(1)

pwdx(1)

ranlib(1)

rcapstat(1)

rcp(1)

rdist(1)

read(1)

readfile(1F)

readonly(1)

red(1)

refer(1)

regcmp(1)

regex(1F)

rehash(1)

reinit(1F)

remote_shell(1)

remsh(1)

renice(1)

repeat(1)

reset(1B)

reset(1F)

return(1)

rksh(1)

rlogin(1)

rm(1)

rmail(1)

rmdel(1)

rmdir(1)

rmformat(1)

roffbib(1)

roles(1)

rpcgen(1)

rpm2cpio(1)

rsh(1)

run(1F)

runat(1)

rup(1)

rup(1C)

ruptime(1)

rusage(1B)

rusers(1)

rwho(1)

sact(1)

sag(1)

sar(1)

sccs(1)

sccs-admin(1)

sccs-cdc(1)

sccs-comb(1)

sccs-delta(1)

sccsdiff(1)

sccs-get(1)

sccs-help(1)

sccs-prs(1)

sccs-prt(1)

sccs-rmdel(1)

sccs-sact(1)

sccs-sccsdiff(1)

sccs-unget(1)

sccs-val(1)

scp(1)

script(1)

sdiff(1)

sed(1)

sed(1B)

select(1)

set(1)

set(1F)

setcolor(1F)

setenv(1)

setfacl(1)

setlabel(1)

setpgrp(1)

settime(1)

sftp(1)

sh(1)

shell(1F)

shell_builtins(1)

shift(1)

shutdown(1B)

size(1)

sleep(1)

snca(1)

snmpstatus(1)

soelim(1)

sort(1)

sortbib(1)

sotruss(1)

source(1)

sparc(1)

spell(1)

spellin(1)

spline(1)

split(1)

srchtxt(1)

ssh(1)

ssh-add(1)

ssh-agent(1)

ssh-http-proxy-connect(1)

ssh-keygen(1)

ssh-keyscan(1)

ssh-socks5-proxy-connect(1)

stop(1)

strchg(1)

strconf(1)

strings(1)

strip(1)

stty(1)

stty(1B)

sum(1)

sum(1B)

sun(1)

suspend(1)

svcprop(1)

svcs(1)

switch(1)

symorder(1)

sysV-make(1)

t300(1)

t300(1B)

t300s(1)

t300s(1B)

t4013(1B)

t4014(1)

t450(1)

t450(1B)

tabs(1)

tail(1)

talk(1)

tar(1)

tbl(1)

tcopy(1)

tee(1)

tek(1)

tek(1B)

telnet(1)

test(1)

test(1B)

test(1F)

tftp(1)

time(1)

timemanp(1)

times(1)

timesysp(1)

timex(1)

tip(1)

tnfdump(1)

tnfxtract(1)

touch(1)

touch(1B)

tplot(1)

tput(1)

tr(1)

tr(1B)

trap(1)

troff(1)

true(1)

truss(1)

tset(1B)

tsort(1)

tty(1)

type(1)

typeset(1)

u370(1)

u3b(1)

u3b15(1)

u3b2(1)

u3b5(1)

ucblinks(1B)

ul(1)

ulimit(1)

umask(1)

unalias(1)

uname(1)

uncompress(1)

unexpand(1)

unget(1)

unhash(1)

unifdef(1)

uniq(1)

units(1)

unix2dos(1)

unlimit(1)

unpack(1)

unset(1)

unset(1F)

unsetenv(1)

until(1)

uptime(1)

users(1B)

uucp(1C)

uudecode(1C)

uuencode(1C)

uuglist(1C)

uulog(1C)

uuname(1C)

uupick(1C)

uustat(1C)

uuto(1C)

uux(1C)

vacation(1)

val(1)

valdate(1)

valgid(1)

valint(1)

valpath(1)

valrange(1)

valstr(1)

valtime(1)

valuid(1)

valyorn(1)

vax(1)

vc(1)

vedit(1)

ver(1)

vgrind(1)

vi(1)

view(1)

vipw(1B)

volcancel(1)

volcheck(1)

volmissing(1)

volrmmount(1)

vplot(1B)

vsig(1F)

w(1)

wait(1)

wc(1)

what(1)

whatis(1)

whence(1)

whereis(1B)

which(1)

while(1)

who(1)

whoami(1B)

whocalls(1)

whois(1)

write(1)

xargs(1)

xgettext(1)

xstr(1)

yacc(1)

yes(1)

ypcat(1)

ypmatch(1)

yppasswd(1)

ypwhich(1)

zcat(1)

zlogin(1)

zonename(1)

pktool

- manage certificates and keys

Synopsis

pktool [-f option_file] [-i] subcommand subcommand_options ...

Description

The pktool command allows users to manage the certificates and keys on multiple keystores including PKCS#11 tokens (that is, Cryptographic Framework), Netscape Security Services (NSS) tokens, and standard file based keystore for OpenSSL.

pktool also provides support to list, delete and import a Certificate Revocation List (CRL). pktool does not provide support for creating CRLs, signing CRLs, or exporting CRLs. The CRL support for the PKCS#11 keystore is file-based.

Options

The following command options are supported:

-f option_file

Allows the user to set up the options in a file instead of entering the options on the command line.

This option is provided as a convenience for users because pktool can potentially have a large list of subcommands and associated options to be specified on the command line.

The format of the option_file is one option or value pair per-line.

An example option_file might looks as follows:

list
keystore=nss
dir=/export/foo
objtype=key
-i

Allows the user to specify the subject-DN interactively for the gencert and gencsr subcommands. When -i is specified, the user is prompted to input some data to form a subject-DN.

An example of using the -i option follows:

Country Name (2 letter code) [US]:US
State or Province Name (full name) [Some-State]:CA
Locality Name (eg, city) []:Menlo Park
Organization Name (eg, company):Sun Microsystems Inc.
Organizational Unit Name (eg, section):OPG
Common Name (eg, YOUR name):John Smith
Email Address []: john.smith@sun.com

The resulting subject-DN is:

"C=US, ST=CA, L=Menlo Park, O=Sun Microsystems Inc., OU=OPG, \
emailAddress=john.smith@sun.com, CN=John Smith"

SUBCOMMANDS

The following subcommands are supported:

delete

The format for the delete subcommand is as follows:

pktool delete [token=token[:manuf[:serial]]]
              [objtype=private|public|both]
              [label=object-label]

pktool delete keystore=pkcs11
              objtype=cert[:public | private | both]]
              [token=token[:manuf[:serial]]]
              [label=cert-label]
              [serial=hex-serial-number]
              [issuer=issuer-DN]
              [subject=subject-DN]

pktool delete keystore=nss
              objtype=cert
              [subject=subject-DN]
              [issuer=issuer-DN]
              [serial=hex-serial-number]
              [nickname=cert-nickname]
              [token=token[:manuf[:serial]]]
              [dir=directory-path]
              [prefix=DBprefix]

pktool delete keystore=nss
              objtype=crl
              [nickname=cert-nickname]
              [subject=subject-DN]
              [token=token[:manuf[:serial]]]
              [dir=directory-path]
              [prefix=DBprefix]

pktool delete keystore=pkcs11
              objtype=key[:public | private | both]]
              [token=token[:manuf[:serial]]]
              [label=key-label]

pktool delete keystore=pkcs11
              objtype=crl
              infile=input-fn
              [dir=directory-path]

pktool delete keystore=file
              objtype=cert
              [infile=input-fn]
              [dir=directory-path]
              [serial=hex-serial-number]
              [issuer=issuer-DN]
              [subject=subject-DN]

pktool delete keystore=file
              objtype=key
              infile=input-fn
              [dir=directory-path]

pktool delete keystore=file
              objtype=crl
              infile=input-fn
              [dir=directory-path]

Deletes a certificate, key, or certificate revocation list (CRL).

To delete a private certificate or key from PKCS#11 token, the user is prompted to authenticate to the PKCS#11 by entering the correct Personal Identification Number (PIN).

download

The format for the download subcommand is as follows:

 pktool download url=url_str 
                 [objtype=crl|cert]
                 [http_proxy=proxy_str]
                 [outfile=output-fn]
                 [dir=directory-path]

Downloads a CRL file or a certificate file from the specified URL location. Once the file is successfully downloaded, checks the validity of the downloaded CRL or certificate file. If the CRL or the certificate is expired, download issues a warning.

export

The format for the export subcommand is as follows:

pktool export [token=token[:manuf[:serial]]]
              outfile=output-fn

pktool export keystore=pkcs11
              outfile=output-fn
              [label=cert-label]
              [subject=subject-DN]
              [issuer=issuer-DN]
              [serial=hex-serial-number]
              [outformat=pem|der|pkcs12]
              [token=token[:manuf[:serial]]]

pktool export keystore=nss
              outfile=output-fn
              [subject=subject-DN]
              [issuer=issuer-DN]
              [serial=hex-serial-number]
              [nickname=cert-nickname]
              [token=token[:manuf[:serial]]]
              [dir=directory-path]
              [prefix=DBprefix]
              [outformat=pem|der|pkcs12]

pktool export keystore=file
              certfile=cert-input-fn
              keyfile=key-input-fn
              outfile=output-pkcs12-fn
              [dir=directory-path]

Saves the contents of PKCS#11 token or certificates in the NSS token or file-based keystore to the specified file.

gencert

The format for the gencert subcommand is as follows:

pktool gencert [-i] keystore=nss
              label=cert-nickname
              subject=subject-DN
              serial=hex_serial_number
              [altname=[critical:]subjectAltName]
              [keyusage=[critical:]usage,usage...]
              [token=token[:manuf[:serial]]]
              [dir=directory-path]
              [prefix=DBprefix]
              [keytype=rsa|dsa]
              [keylen=key-size]
              [trust=trust-value]
              [lifetime=number-hour|number-day|number-year]

pktool gencert [-i] [ keystore=pkcs11]
              label=key/cert-label
              subject=subject-DN
              serial=hex_serial_number
              [altname=[critical:]subjectAltName]
              [keyusage=[critical:]usage,usage...]
              [token=token[:manuf[:serial]]]
              [dir=directory-path]
              [keytype=rsa|dsa]
              [keylen=key-size]
              [lifetime=number-hour|number-day|number-year]
              
pktool gencert [-i] keystore=file
              outcert=cert-fn
              outkey=key-fn
              subject=subject-DN
              serial=hex_serial_number
              [altname=[critical:]subjectAltName]
              [keyusage=[critical:]usage,usage...]
              [format=der|pem]
              [dir=directory-path]
              [keytype=rsa|dsa]
              [keylen=key-size]
              [lifetime=number-hour|number-day|number-year]
              

Generates a self-signed certificate and installs it and its associated private key to the specified keystore.

gencert prompts the user to enter a PIN for token-based keystore.

gencsr

The format for the gencsr subcommand is as follows:

pktool gencsr [-i] keystore=nss
              nickname=key-nickname
              outcsr=csr-fn
              subject=subject-DN
              [altname=[critical:]subjectAltName]
              [keyusage=[critical:]usage,usage...]
              [token=token[:manuf[:serial]]]
              [dir= NSS directory-path]
              [prefix=DBprefix]
              [keytype=rsa|dsa]
              [keylen=key-size]
              [format=pem|der]
             
pktool gencsr [-i] keystore=pkcs11
              label=key-label              outcsr=csr-fn
              subject=subject-DN
              [altname=[critical:]subjectAltName]
              [keyusage=[critical:]usage,usage...]
              [token=token[:manuf[:serial]]]
              [keytype=rsa|dsa]
              [keylen=key-size]
              [format=pem|der]
             
pktool gencsr [-i] keystore=file
              outcsr=csr-fn
              outkey=key-fn
              subject=subject-DN
              [altname=[critical:]subjectAltName]
              [keyusage=[critical:]usage,usage...]
              [dir=directory-path]
              [keytype=rsa|dsa]
              [keylen=key-size]
              [format=pem|der]

Creates a PKCS#10 certificate signing request (CSR) file. This CSR can be sent to a Certifying Authority (CA) for signing. The gencsr subcommand prompts the user to enter a PIN for token-based keystore.

The format for the genkey subcommand is as follows:

pktool genkey [keystore=pkcs11]
              label=key-label
              [keytype=aes|arcfour|des|3des|generic]
              [keylen=key-size (for aes, arcfour, or generic keytypes only)]
              [token=token[:manuf[:serial]]]
              [sensitive=y|n]
              [extractable=y|n]
              [print=y|n]

pktool genkey keystore=nss
              label=key-label
              [keytype=aes|arcfour|des|3des|generic]
              [keylen=key-size (AES, ARCFOUR, or GENERIC only)]
              [token=token[:manuf[:serial]]]
              [dir=directory-path]
              [prefix=DBprefix]

pktool genkey keystore=file
              outkey=key-fn
              [keytype=aes|arcfour|des|3des|generic]
              [keylen=key-size (AES, ARCFOUR, or GENERIC only)]
              [dir=directory-path]
              [print=y|n]

Generates a symmetric key in the specified keystore. The genkey subcommand prompts the user to enter a PIN for token-based keystore.

import

The format for the import subcommand is as follows:

pktool import [token=token>[:manuf>[:serial>]]]
              infile=input-fn

pktool import [keystore=pkcs11]
              infile=input-fn
              label=cert-label
              [token=token[:manuf[:serial]]]
              [objtype=cert]

pktool import keystore=pkcs11
              objtype=crl
              infile=input-fn
              outcrl=output-crl-fn
              outformat=pem|der
              [dir=output-crl-directory-path]

pktool import keystore=nss
              objtype=cert
              infile=input-fn
              nickname=cert-nickname
              [token=token[:manuf[:serial]]]
              [dir=directory-path]
              [prefix=DBprefix]
              [trust=trust-value]

pktool import keystore=nss
              objtype=crl
              infile=input-fn
              [verifycrl=y|n]
              [token=token[:manuf[:serial]]]
              [dir=directory-path]
              [prefix=DBprefix]

pktool import keystore=file
              infile=input-fn
              outkey=output-key-fn
              outcert=output-key-fn
              [dir=output-cert-directory-path]
              [keydir=output-key-directory-path]
              [outformat=pem|der]

pktool import keystore=file
              objtype=crl
              infile=input-fn
              outcrl=output-crl-fn
              outformat=pem|der
              [dir=output-crl-directory-path]

Loads certificates, keys, or CRLs from the specified input file into the specified keystore.

inittoken

The format for the inittoken subcommand is as follows:

pktool inittoken [slotid=slot number]
                 [currlabel=token[:manuf[:serial]]]
                 [newlabel=new token label]

This command initializes a PKCS#11 token using C_InitToken API. The preferred method of locating a token is to specify its default label. Optionally, a new label can be assigned to the token by using the newlabel argument. If newlabel is not present, the token label is not modified. The user is prompted to enter the security officer (SO) PIN for this command to proceed.

list

The format for the list subcommand is as follows:

pktool list [token=token[:manuf[:serial]]]
            [objtype=private|public|both]
            [label=label]

pktool list [keystore=pkcs11]
            [objtype=cert[:public | private | both]]
            [token=token[:manuf[:serial]]]
            [label=cert-label]
            [serial=hex-serial-number]
            [issuer=issuer-DN]
            [subject=subject-DN]

pktool list [keystore=pkcs11]
            objtype=key[:public | private | both]]
            [token=token[:manuf[:serial]]]
            [label=key-label]

pktool list keystore=pkcs11
            objtype=crl
            infile=input-fn
            [dir=directory-path]

pktool list keystore=nss
            objtype=cert
            [subject=subject-DN]
            [issuer=issuer-DN]
            [serial=hex-serial-number]
            [nickname=cert-nickname]
            [token=token[:manuf[:serial]]]
            [dir=directory-path]
            [prefix=DBprefix]

pktool list keystore=nss
            objtype=key
            [token=token[:manuf[:serial]]]
            [dir=directory-path]
            [prefix=DBprefix]
            
pktool list keystore=file
            objtype=cert
            [infile=input-fn]
            [dir=directory-path]
            [serial=hex-serial-number]
            [issuer=issuer-DN]
            [subject=subject-DN]

pktool list keystore=file
            objtype=key
            infile=input-fn
            [dir=directory-path]

Lists certificates, list keys, or list certificate revocation lists (CRL). When displaying a private certificate or key in PKCS#11 token, the user is prompted to authenticate to the PKCS#11 token by entering the correct PIN.

setpin

The format for the setpin subcommand is as follows:

pktool setpin keystore=nss
       [token=token]
       [dir=directory-path]
       [prefix=DBprefix]

pktool setpin [ keystore=pkcs11]
       [token=token[:manuf[:serial]]]

Changes the passphrase used to authenticate a user to the PKCS#11 or NSS token. Passphrases can be any string of characters with lengths between 1 and 256 with no nulls.

setpin prompts the user for the old passphrase, if any. If the old passphrase matches, pktool prompts for the new passphrase twice. If the two entries of the new passphrases match, it becomes the current passphrase for the token.

For the Sun Software PKCS#11 softtoken keystore (default), the user must use the setpin command with the default passphrase changeme as the old passphrase to change the passphrase of the object store. This action is needed to initialize and set the passphrase to a newly created token object store.

tokens

The format for the tokens subcommand is as follows:

pktool tokens

The tokens subcommand lists all visible PKCS#11 tokens.

-?

The format for the subcommand is as follows:

pktool -?
pktool --help

The -? option displays usage and help information. --help is a synonym for -?.

Usage

The pktool subcommands support the following options:

altname=[critical:]subjectAltName

Subject Alternative Names the certificate. The argument that follows the -A option should be in the form of tag=value. Valid tags are IP, DNS, EMAIL, URI, DN, and RID. The SubjectAltName extension is marked as critical if the altname string is prepeneded with the word critical.

Example 1: Add an IP address to the subjectAltName extension. altname="IP=1.2.3.4" Example 2: Add an email address to the subjectAltName extension, and mark it as being critical. altname="critical:EMAIL=first.last@company.com"

currlabel=token label

This option is only used by the inittoken command. This is used to locate the default token that is being initialized. See the token option for details about the format of the token name to be used.

dir=directory_path

Specifies the NSS database directory, or OpenSSL keystore directory where the requested object is stored.

extractable=y | n

Specifies the resulting symmetric key in the PKCS#11 token is extractable or not extractable. The valid values are: y and n. The default value is y.

format=pem | der | pkcs12

For the gencert subcommand, this option only applies to the file based keystore such as OpenSSL. It is used to specify the output format of the key or certificate file to be created. The valid formats are: pem or der. The default format is pem.

For the gencsr subcommand, this option specifies the output encoded format of the CSR file. The valid formats are: pem or der. The default format is pem.

infile=input-fn

Specifies the certificate filename for list and delete subcommands when objtype=cert and keystore=file. For the import subcommand, this option specifies the filename to be imported. Specifies the input CRL filename for list, delete and import subcommands when objtype=crl.

issuer=issuer-DN

Specifies the issuer of a certificate.

keylen=key-size

Specifies the size (bits) of the private or symmetric key to generate.

For the gencert and gencsr subcommands, the default key length is 1024 bits.

For the genkey subcommand, the minimum and maximum bits of the symmetric key to generate using AES algorithm are 128 and 256. Using the ARCFOUR algorithm, the minimum and maximum bits are 8 and 2048. The minimum bits for a generic secret key is 8 and the maximum bits is arbitrary. The default key length for the AES, ARCFOUR or generic secret keys is 128. For a DES key or a 3DES key, the key length is fixed and this option is ignored if specified.

keystore=nss | pkcs11 | file

Specifies the type of the underlying keystore: NSS token, PKCS#11 token, or file-based plugin.

keytype=rsa | dsa | aes | arcfour | des | 3des | generic

Specifies the type of the private or symmetric key to generate.

For the gencert and gencsr subcommands, the valid private key types are: rsa, or dsa. The default key type is rsa.

For the genkey subcommand, the valid symmetric key types are: aes, arcfour, des, 3des, or generic. The default key type is aes.

 keyusage=[critical:]usage,usage,usage,...
Key Usage strings:
* digitalSignature
* nonRepudiation
* keyEncipherment
* dataEncipherment
* keyAgreement
* keyCertSign
* cRLSign
* encipherOnly
* decipherOnly

Example 1: Set the KeyUsage so that the cert (or csr) can be used for signing and verifying data other than certificates or CRLs (digitalSignature) and also can be used for encrypting and decrypting data other than cryptographic keys (dataEncipherment). keyusage=digitalSignature,dataEncipherment

Example 2: The same as above (Example 1), but with the critical bit set. keyusage=critical:digitalSignature,dataEncipherment

label=key-label | cert-label

For the gencert subcommand, this option specifies the label of the private key and self-signed certificate in the PKCS#11 token.

For the gencsr subcommand, this option specifies the label of the private key in the PKCS#11 token.

For the list subcommand, this option specifies the label of the X.509 Certificate (when objtype=key) or the private key (when objtype=cert) in the PKCS#11 token to refine the list.

For the delete subcommand, this option specifies the label of the X.509 Certificate (when objtype=key) or the private key (when objtype=cert) to delete a designated object from the PKCS#11 token.

lifetime=number-hour|number-day|number-year

Specifies the validity period a certificate is valid. The certificate life time can be specified by number-hour, number-day, or number-year. Only one format can be specified. The default is 1-year. Examples of this option might be: lifetime=1-hour, lifetime=2-day, lifetime=3-year

newlabel=token label

This option is only used by the inittoken command. This is used to change the label assigned to the token that is being initialized. See the token option for details about the format of the token name to be used.

nickname=cert-nickname

For the gencert subcommand, this option is required to specify the certificate's nickname for NSS keystore.

For the list subcommand, this option specifies the nickname of the certificate in the NSS token to display its content. For the delete subcommand, to delete a CRL from the NSS token, this option is used to specify the nickname of the issuer's certificate. For the delete subcommand, to delete a certificate from the NSS token, this option specifies the nickname of the certificate. For the import subcommand, to import a specified input file to the NSS token, this option is required to specify the nickname of the resulting certificate.

objtype=cert | key | crl

Specifies the class of the object: cert, key, or crl. For the download subcommand, if this option is not specified, default to crl.

objtype=public | private | both

Specifies the type of object: private object, public object, or both. This option only applies to list and delete subcommands for the PKCS#11 token when objtype=key is specified. The default value is public.

For the list subcommand, the label option can be combined with this option to further refine the list of keys. For the delete subcommand, this option can used to narrow the keys to be deleted to only public, or private ones. Alternately, the label option can be omitted to indicate that all public, private, or both type of keys are to be deleted. The use of public, private and both as choices for the objtype parameter are only applicable with the PKCS#11 keystore in order to maintain compatibility with earlier versions of the pktool command.

outcert=cert-fn

Specifies the output certificate filename to write to. This option is required for the file based plugin such as OpenSSL. Option outkey=key-fn is required with this option.

outcrl=output-crl-fn

Specifies the output CRL filename to write to.

outcsr=csr-fn

Specifies the output CSR filename to write to.

outfile=output-fn

For the export subcommand, this option specifies the output filename to be created. For the import subcommand, this option specifies the output filename of the certificate or CRL. It only applies to the file based plugin such as OpenSSL. For the download subcommand, if this option is not specified, the downloaded file name is the basename of the URL string.

outformat=pem | der | pkcs12

For the import subcommand, this option specifies the output format of the certificate or key that is extracted from a specified PKCS#12 file into the file based plugin, The valid values are: pem or der. The default is pem. When importing a CRL to the CRL file based keystore, this option specifies the output format of the CRL. The valid values are: pem or der. The default is der. For the export subcommand, this option specifies the format of the specified output file to be created. The supported formats are: pem, der or pkcs12. The default is pkcs12.

outkey=key-fn

Specifies the output private key filename to which to write. This option is only required when using the files keystore.

prefix=DBprefix

Specifies the NSS database prefix. This option only applies to the NSS token.

print=y | n

This option is used in the genkey subcommand and it applies to the PKCS11 and File-based keystores. If print=y, the genkey subcommand prints out the key value of the generated key in a single line of hex. The default value is n. For the PKCS11 keystore, if a symmetric key is created with sensitive=y or extractable=n, the key value is not displayed, even the print option is set to y. The key is still created, but a warning like cannot reveal the key value is issued.

sensitive=y | n

Specifies the resulting symmetric key in the PKCS#11 token is sensitive or not sensitive. The valid values are: y and n. The default value is n.

serial=hex-serial-number

Specifies a unique serial number for a certificate. The serial number must be specified as a hex value. Example: 0x0102030405060708090a0b0c0d0e0f

subject=subject-DN

Specifies a particular certificate owner for a certificate or certificate request. An example subject= setting might be:

subject=O=Sun Microsystems Inc., \
 OU=Solaris Security Technologies Group, \ 
L=Ashburn, ST=VA, C=US, CN=John Smith
token=token[:manuf[:serial]]

When a token label contains trailing spaces, this option does not require them to be typed as a convenience to the user.

Colon separate token identification string.token_label:manufacturer:serialIf any of the parts have a literal : char then it needs to be escaped using a backslash (\). If no : is found then the entire string (up to 32 chars) is taken as the token label. If only one : is found then the string is the token label and the manufacturer. When keystore=nss is specified, default to NSS internal token if this option is not specified. When keystore=pkcs11 is specified, default to pkcs11_softtoken if this option is not specified.

trust=trust-value

Specifies the certificate trust attributes. This is only for NSS certificates and that the standard NSS syntax applies.

url=url_string

Specifies the URL to download a CRL or a certificate file.

verifycrl=y | n

When importing a CRL to NSS keystore, this option specifies whether the CRL verification is performed. The valid values are: y and n. The default value is n.

http_proxy=proxy_str

Specifies the proxy server hostname and port number. The format can be either http://hostname[:port] or hostname[:port]. If this option is not specified, the download subcommand checks the http_proxy environment variable. The command line option has a higher priority than the environment variable.

Examples

Example 1 Generating a Self-Signed Certificate

The following example creates the certificate and stores it in the keystore indicated in the command:

 $ pktool gencert keystore=nss nickname=WebServerCert \
       subject="O=Sun Microsystems Inc., OU=Solaris Security Technologies Group, \
       L=Ashburn, ST=VA, C=US, CN=John Smith" dir=/etc/certs \
       keytype=rsa keylen=2048

Example 2 Generating a Certificate Signing Request

The following example creates the CSR and stores it in the keystore indicated in the command:

 $ pktool gencsr keystore=nss subject="O=Sun Microsystems Inc., \
       OU=Solaris Security Technologies Group, L=Ashburn, ST=VA, C=US, \
       CN=John Smith" keytype=rsa keylen=2048 outcsr=csr.dat

Example 3 Importing a Certificate

The following example imports a certificate object from the specified input file into the keystore indicated in the command:

 $ pktool import keystore=nss objtype=cert infile=mycert.pem \
       nickname=mycert

Exit Status

The following exit values are returned:

0

Successful completion.

>0

An error occurred.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
SUNWcsu
Interface Stability
Evolving

See Also

attributes(5), pkcs11_softtoken(5)

RSA PKCS#11 v2.11 http://www.rsasecurity.com

RSA PKCS#12 v1.0 http://www.rsasecurity.com