This commit is contained in:
commit
6a62578d23
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
466
init_perso_guide.html
Normal file
466
init_perso_guide.html
Normal file
@ -0,0 +1,466 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html><head>
|
||||
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>init_perso_guide</title></head>
|
||||
|
||||
<body>
|
||||
<h1>OpenSC card init and perso guide</h1>
|
||||
<h2>1. Introduction</h2>
|
||||
<div style="text-align: center;"><span style="font-style: italic;">Nothing
|
||||
is impossible for the man who doesn't</span><br style="font-style: italic;">
|
||||
|
||||
<span style="font-style: italic;">have
|
||||
to do it himself. -- A.H. Weiler</span><br>
|
||||
</div>
|
||||
<br>
|
||||
This guide is about initialising and personalising (no distinction
|
||||
made) cards with the OpenSC library and tools (mostly pkcs15-init).<br>
|
||||
<br>
|
||||
Some knowlegde about smart cards is assumed. Below is a short overview
|
||||
of some key words and concepts. For more info, see the opensc.html
|
||||
manual.<br>
|
||||
<br>
|
||||
<span style="font-weight: bold;">Filesystem - MF - DF - EF - FID</span><br>
|
||||
A smart cards has a non-volatile memory (EEPROM) in which usually
|
||||
a PC-like file system is implemented. The directories are called
|
||||
Dedicated Files (DF) and the files are called Elementary Files (EF).
|
||||
They are
|
||||
identified by a File ID (FID) on 2 bytes. For example, the root of
|
||||
the file system
|
||||
(called Master File or MF) has FID = 3F 00 (hex).<br>
|
||||
<br>
|
||||
<span style="font-weight: bold;">Commands - APDUs</span><br>
|
||||
It is possible to send commands (APDUs) to the card to select, read,
|
||||
write, create, list, delete, ... EFs and DFs (not all cards allow all
|
||||
commands).<br>
|
||||
<br>
|
||||
<span style="font-weight: bold;">Access control, PIN, PUK</span><br>
|
||||
The file system usually implements some sort of access control on EFs
|
||||
and DFs.<br>
|
||||
This is usually done by PINs or Keys: you have to provide a PIN or show
|
||||
knowledge of a key before you can perform some command on some EF/DF. A
|
||||
PIN is usually accompanied by a PUK (Pin Unblock Key), which can be
|
||||
used to
|
||||
reset (or unblock) that PIN.<br>
|
||||
<br>
|
||||
<span style="font-weight: bold;">Cryptographic keys</span><br>
|
||||
On crypto cards, it is also possible to sign, decrypt, key(pair)
|
||||
generation (what can be done exactly depends on the card). on some
|
||||
cards, key
|
||||
and/or PINs are files in the filesystem, on other cards, they don't
|
||||
exist in the filesystem but are referenced through an ID.<br>
|
||||
<br>
|
||||
<span style="font-weight: bold;">Reader - PC/SC - OpenCT - CT-API</span><br>
|
||||
Smart card readers come with a library that can be used on a PC to send
|
||||
APDUs to the card. Commonly used APIs for those libraries are PC/SC,
|
||||
OpenCT
|
||||
and CT-API.<br>
|
||||
<br>
|
||||
<span style="font-weight: bold;">PKCS15</span><br>
|
||||
There are standards (e.g. ISO7816, parts 4-...) that specify how to
|
||||
select, read, write, EFs and DFs, and how to sign, decrypt, login, ...<br>
|
||||
However, there is also a need to know which files contain what, or
|
||||
where the keys, PINs, .. can be found.<br>
|
||||
For crypto cards, PCKS15 adresses this need by defining some files that
|
||||
contain info on where to find keys, certificates, PINs, and other data.
|
||||
For
|
||||
example, there is a PrKDF (Private Key Directory File) that contains
|
||||
the EFs or
|
||||
ID of the private keys, what those keys can be used for, by which PINs
|
||||
they
|
||||
are protected, ... So a "PCKS15 card" is nothing but any other card on
|
||||
which the right set
|
||||
of files has been added.<br>
|
||||
In short: PKCS15 allows you to describe where to find PINS, keys,
|
||||
certificates and data on a card, plus all the info that is needed to
|
||||
use them.<br>
|
||||
<h3>A little PKCS15 example:</h3>
|
||||
Here's the textual contents of 3 PKCS15 files: the AODF (Authentication
|
||||
Object Directory File), PrKDF (Private Key Directory File) and CDF
|
||||
(Certificate Directory File) that contain info on resp. the PINs,
|
||||
private keys and certificates. Each of them contains 1 entry.<br>
|
||||
<br>
|
||||
AODF:
|
||||
<pre> Com. Flags : private, modifiable<br> Auth ID : 01<br> Flags : [0x32], local, initialized, needs-padding<br> Length : min_len:4, max_len:8, stored_len:8<br> Pad char : 0x00<br> Reference : 1<br> Encoding : ASCII-numeric<br> Path : 3F005015<br></pre>
|
||||
PrKDF:
|
||||
<pre> Com. Flags : private, modifiable<br> Com. Auth ID: 01<br> Usage : [0x32E], decrypt, sign, signRecover, unwrap, derive, nonRep<br> Access Flags: [0x1D], sensitive, alwaysSensitive, neverExtract, local<br> ModLength : 1024<br> Key ref : 0<br> Native : yes<br> Path : 3F00501530450012<br> ID : 45<br></pre>
|
||||
X.509 Certificate [/C=BE/ST=...]
|
||||
<pre> Com. Flags : modifiable<br> Authority : no<br> Path : 3f0050154545<br> ID : 45</pre>
|
||||
Some things to note:<br>
|
||||
<ul>
|
||||
<li>The Auth ID (01) of the private key is the same as the one of the
|
||||
PIN which
|
||||
means
|
||||
that you first have to do a login with this PIN before
|
||||
you can use this key.</li>
|
||||
<li>The key is in an EF with ID = 0012 in the DF with ID = 3045,
|
||||
which
|
||||
on it is turn is a DF with ID 5015, which on it is turn is a DF of
|
||||
the MF (3F00).</li>
|
||||
<li>The private key and certificates share the same ID (45), which
|
||||
means that they
|
||||
belong together.</li>
|
||||
<li>The certificate is in the EF with as path: 3F00\5015\3045
|
||||
and is no CA
|
||||
certificate.</li>
|
||||
</ul>
|
||||
Use the <span style="font-weight: bold;">tests/p15dump</span> tool to
|
||||
see yourself what pkcs15 data is on your card, or <span style="font-weight: bold;">tools/opensc-explorer</span> to browse
|
||||
through the files.<br>
|
||||
<br>
|
||||
Have the PKCS15 files a fixed place so everyone can find them? No,
|
||||
there's only one: the EF(DIR) in the MF and with ID 2F00. That's the
|
||||
starting
|
||||
place.<br>
|
||||
<br>
|
||||
<h2>2. The OpenSC pkcs15-init library and profiles</h2>
|
||||
Reading and writing files, PIN verification, signing and decryption
|
||||
happen in much the same way on all cards. Therefore, the "normal life"
|
||||
commands have been implemented in OpenSC for all supported cards.<br>
|
||||
<br>
|
||||
However, creating and deleting files, PINs and keys is very card
|
||||
specific and has not yet been implemented for all cards.
|
||||
Currently, pkcs15-init is implemented for: Cryptoflex, Cyberflex,
|
||||
CardOS (etoken), GPK, Miocos, Starcos JCOP and Oberthur. (Check
|
||||
src/pkcs15-init/pkcs15-*.c for possible updates). Because of this, and
|
||||
because
|
||||
pkcs15-init is not necessary for "normal life" operations, it has been
|
||||
put in a separate library and in a separate directory.<br>
|
||||
<br>
|
||||
<span style="font-weight: bold;">Profile</span><br>
|
||||
Because the initialisation/personalisation is so card-specific, it
|
||||
would be very hard to make a tool or API that accepts all parameters
|
||||
for all current and future cards.<br>
|
||||
Therefore, a profile file has been made in OpenSC that contains all the
|
||||
card-specific parameters. This card-specific profile is read by
|
||||
card-specific code in the pkcs15-init library each time this library is
|
||||
used on
|
||||
that card.<br>
|
||||
See the *.profile files in src/pkcs15-init/. There is one general file
|
||||
(pkcs15.profile) and one card-specific profile for each card.<br>
|
||||
<br>
|
||||
<span style="font-weight: bold;">Profile options</span><br>
|
||||
There are currently 3 options you can specify to modify a profile:<br>
|
||||
<ul>
|
||||
<li>default: creation/deletion/generation is controlled by the SO PIN
|
||||
(SO = Security Officer, different from the regular user of the card)</li>
|
||||
<li>onepin: creation/deletion/generation is controlled by the user
|
||||
PIN and thus by the user. As a result, only 1 user PIN is possible</li>
|
||||
<li>small: like default, but suitable for card with little memory</li>
|
||||
</ul>
|
||||
<h2>3. pkcs15-init tool</h2>
|
||||
This is a command-line tool that uses the pkcs15-init library. It
|
||||
allows you to do all the init/perso things, e.g. add/delete keys,
|
||||
certificates, PINs and data, generate keys, ... while specifying key
|
||||
usage, which PIN protects which key, ...<br>
|
||||
<br>
|
||||
As said before, not all cards are supported in the pkcs15-init library.
|
||||
In
|
||||
that case, the pkcs15-init tool won't work (top 5 questions on the
|
||||
mailing list:-). To find out which card you have, try "<span style="font-style: italic;">opensc-tool -n</span>"<br>
|
||||
<br>
|
||||
Below is explained how to do the operations that are supported by
|
||||
pkcs15-tool.<br>
|
||||
Not all options are explained (run "<span style="font-style: italic;">pkcs15-tool
|
||||
-h</span>" to see them) because some are card-specific or obsolete (or
|
||||
we don't know about them). Feel free to experiment and explain them
|
||||
here.<br>
|
||||
<br>
|
||||
So the things in this section are fairly general but not guaranteed to
|
||||
work for all cards. See also the section on "card-specific issues".<br>
|
||||
<br>
|
||||
The --reader or -r can be given with any command. By default the first
|
||||
reader is used. Do "<span style="font-style: italic;">opensc-tool -l</span>"
|
||||
to see the list of available readers.<br>
|
||||
<br>
|
||||
To see the results of what you did, you can do one of the following:<br>
|
||||
<span style="font-style: italic;">pkcs15-tool --list-pins
|
||||
--list-public-keys -k -c -C</span><br>
|
||||
<span style="font-style: italic;">p15dump</span> (in the
|
||||
src/tests directory)<br>
|
||||
To see/dump the content of any file, use the <span style="font-style: italic;">opensc-explorer</span> tool.<br>
|
||||
<h3>* Create the PKCS15 files</h3>
|
||||
<span style="font-style: italic;">pkcs15-init
|
||||
-C {-T} {-p <profile>} </span><span style="font-style: italic;">--so-pin
|
||||
<PIN> --so-puk <PUK> | --no-so-pin | --pin <PIN>
|
||||
--puk <PUK><br>
|
||||
<br>
|
||||
</span>This will create the PKCS15 DF (5015) and all the PKCS15 files
|
||||
(some of which will be empty until a key, PIN, ... will be added). It
|
||||
must be done before you can do any of the operations below.<br>
|
||||
<ul>
|
||||
<li>This operation usually requires a 'transport' key. pkcs15-init
|
||||
will ask you for this key and propose the default one for that card.
|
||||
With -T, the default will be used without asking. NOTE: if you get a
|
||||
"Failed to erase card: PIN code or key incorrect", the transport key is
|
||||
wrong. Find this key and then try again, DO NOT try the default key
|
||||
again!</li>
|
||||
<li>If you want an SO PIN and PUK, do so with the --so-pin and
|
||||
--so-puk options, or specify --no-so-pin if you don't want to. If you
|
||||
use
|
||||
the onpin profile, there is no SO PIN so you should specify --pin and
|
||||
--puk instead. (So you get: pkcs15-init -CT -p pkcs15+onepin --pin
|
||||
<PIN> --puk <PUK>)</li>
|
||||
<li>To specify the profile file + option. The profile file can only
|
||||
be "pkcs15" for the moment, so you can have:<br>
|
||||
pkcs15+default : the default (not needed to
|
||||
specify it)<br>
|
||||
pkcs15+onepin: for the onepin profile
|
||||
option<br>
|
||||
pkcs15+small: for the small
|
||||
profile option</li>
|
||||
</ul>
|
||||
<h3>* Erase the card's content</h3>
|
||||
<span style="font-style: italic;">pkcs15-init
|
||||
-E {-T}</span><br>
|
||||
<br>
|
||||
This will delete all keys, PINS, certificates, data that were listed in
|
||||
PKCS15
|
||||
files, along with the PKCS15 files themselves.<br>
|
||||
<ul>
|
||||
<li>This operation usually requires a 'transport' key. pkcs15-init
|
||||
will ask you for this key and propose the default one for that card.
|
||||
With -T, the default will be used without asking. NOTE: if you get a
|
||||
"Failed to erase card: PIN code or key incorrect", the transport key is
|
||||
wrong. Find this key and then try again, DO NOT try the default key
|
||||
again!</li>
|
||||
</ul>
|
||||
Note: you can combine erase/create (-E -C or -EC) to erase and then
|
||||
create<br>
|
||||
the card's contents, except when you change the profile option.<br>
|
||||
<h3>* Add a PIN (not possible with the onepin profile option)</h3>
|
||||
<span style="font-style: italic;">pkcs15-init
|
||||
-P {-a <AuthID>} {--pin <PIN>} {--puk <PUK>} {-l
|
||||
<label>}</span><br>
|
||||
<ul>
|
||||
<li>You can specify the AuthID with -a, if you don't do so, a value
|
||||
that didn't exist yet on the card will be chosen.</li>
|
||||
<li>Specify the PIN and PUK with --pin and --puk, if you don't do so,
|
||||
the tool will prompt you for one.</li>
|
||||
<li>Specify the label (name) of the PIN with -l, or accept the
|
||||
default label.</li>
|
||||
</ul>
|
||||
<h3>* Generate a key pair (on card or in software on the PC)</h3>
|
||||
<span style="font-style: italic;">pkcs15-init
|
||||
-G <keyspec> -a <AuthID> --insecure {-i <ID>}
|
||||
{--soft}{-u <keyusage>}{-l <privkeylabel>}
|
||||
{--public-key-label <pubkeylabel>}</span><br>
|
||||
<br>
|
||||
This will generate a public and private key pair.<br>
|
||||
<ul>
|
||||
<li>The keyspec consist of the key type, rsa or dsa (depends on what
|
||||
your cards supports), and optinally a slash followed by the keysize in
|
||||
bits. E.g. "rsa/1024" specifies a 1024 bit RSA key pair. Note: dsa is
|
||||
not
|
||||
fully supported.</li>
|
||||
<li>Specify the AuthID of the PIN that protects this key (from being
|
||||
used in a signature or decryption operation) with -a; or specify
|
||||
--insecure if you want the private key to be used without first
|
||||
providing a PIN.</li>
|
||||
<li>Specify the ID of the key with -i, otherwise the tool with choose
|
||||
one.</li>
|
||||
<li>Specify --soft if you don't want the key pair to be generated
|
||||
on-chip.</li>
|
||||
<li>Specify the usage of the private key with -u; if you add a
|
||||
corresponding certificate later, it should have the same key usage. (Do
|
||||
"pkcs15-init -u help" for help).</li>
|
||||
<li>Specify the label (name) of the private key with -l, or accept
|
||||
the default label.</li>
|
||||
<li>Specify the label (name) of the public key with
|
||||
--public-key-label, or accept the default label if you don't do so.</li>
|
||||
<li>Depending on your card and profile option, you will be prompted
|
||||
to provide your SO PIN and/or PIN; if you don't want to be prompted,
|
||||
add them to the command line with --so-pin <SOPIN> and/or --pin
|
||||
<PIN>.</li>
|
||||
</ul>
|
||||
NOTE: see the SSL engines (below) on how to make a certificate request
|
||||
with the key you generated.<br>
|
||||
<h3>* Add a private key</h3>
|
||||
<span style="font-style: italic;">pkcs15-init
|
||||
-S <keyfile> {-f <keyformat>} -a <AuthID> --insecure
|
||||
{-i <ID>} {-u <keyusage>} {--passphrase <password>}
|
||||
{-l <label>}</span><br>
|
||||
<ul>
|
||||
<li>The keyfile should be in DER (binary) or PEM format.</li>
|
||||
<li>The keyformat should be PEM (default) or DER.</li>
|
||||
<li>Specify the AuthID of the PIN that protects this key (from being
|
||||
used in a signature or decryption operation) with -a; or specify
|
||||
--insecure if you want the private key to be used without first
|
||||
providing a PIN.</li>
|
||||
<li>Specify the ID of the key with -i</li>
|
||||
<>Specify the usage of the private key with -u; if you add a
|
||||
corresponding certificate later, it should have the same key usage. (Do
|
||||
"pkcs15-init -u help" for help). <li>Specify the label (name) of
|
||||
the with -l, or accept the
|
||||
default label.</li>
|
||||
<li>Depending on your card and profile option, you will be prompted
|
||||
to provide your SO PIN and/or PIN; if you don't want to be prompted,
|
||||
add them to the command line with --so-pin <SOPIN> and/or --pin
|
||||
<PIN>.</li>
|
||||
</ul>
|
||||
<h3>* Add a private key + certificate(s) (in a pkcs12 file)</h3>
|
||||
<span style="font-style: italic;">pkcs15-init
|
||||
-S <pkcs12file> -f PKCS12 -a <AuthID> {--insecure} {-i
|
||||
<ID>} {-u <keyusage>} {--passphrase <password>} {-l
|
||||
<privkeylabel>} {--cert-label <usercertlabel>}</span><br>
|
||||
<br>
|
||||
This adds the private key and certificate chain to the card. If a
|
||||
certificate already exists on the card, it won't be added again.<br>
|
||||
<ul>
|
||||
<li>Specify the AuthID of the PIN that protects this key (from being
|
||||
used in a signature or decryption operation) with -a; or specify
|
||||
--insecure if you want the private key to be used without first
|
||||
providing a PIN.</li>
|
||||
<li>Specify the ID of the key and the corresponding certificate with
|
||||
-i,
|
||||
otherwise the tool with choose one; only the 'user cert' will get the
|
||||
same ID as the key, the other certificates will get 'authority' status
|
||||
and
|
||||
another ID.</li>
|
||||
<li>You can specify the key-usage, but it is not advised to do this
|
||||
so the key usage from the certificate is used.</li>
|
||||
<li>Specify the password of the pkcs12 key file if you don't want to
|
||||
be prompted for one.</li>
|
||||
<li>Specify the label (name) of the private key with -l, or accept
|
||||
the default label.</li>
|
||||
<li>Specify the label (name) of the user certificate with
|
||||
--cert-label, or accept the default label.</li>
|
||||
<li>Depending on your card and profile option, you will be prompted
|
||||
to provide your SO PIN and/or PIN; if you don't want to be prompted,
|
||||
add them to the command line with --so-pin <SOPIN> and/or --pin
|
||||
<PIN>.</li>
|
||||
</ul>
|
||||
<h3>* Add a certificate</h3>
|
||||
<span style="font-style: italic;">
|
||||
pkcs15-init -W <certfile> {-f <certformat>} {-i <ID>}
|
||||
{--authority}</span><br>
|
||||
<ul>
|
||||
<li>The certfile should be in DER (binary) or PEM format</li>
|
||||
<li>The certformat should be PEM (default) or DER</li>
|
||||
<li>Specify the ID of the certificate with -i, otherwise the tool
|
||||
with
|
||||
choose one; if the certificate corresponds to a private and/or public
|
||||
key, you
|
||||
should specify the same ID as that key.</li>
|
||||
<li>Specify --authority if it is a CA certificate.</li>
|
||||
<li>Depending on your card and profile option, you will be prompted
|
||||
to
|
||||
provide your SO PIN and/or PIN; if you don't want to be prompted, add
|
||||
them to the command line with --so-pin <SOPIN> and/or --pin
|
||||
<PIN>.</li>
|
||||
</ul>
|
||||
<h3>* Add a public key</h3>
|
||||
<span style="font-style: italic;">pkcs15-init
|
||||
--store-public-key <keyfile> {-f <keyformat>} {-i
|
||||
<ID>} {-l <label>}</span><br>
|
||||
<ul>
|
||||
<li>The keyfile should be in DER (binary) or PEM format</li>
|
||||
<li>The keyformat should be PEM (default) or DER</li>
|
||||
<li>Specify the ID of the key with -i, otherwise the tool with choose
|
||||
one; if the key corresponds to a private key and/or certificate, you
|
||||
should
|
||||
specify the same ID as that private key and/or certificate.</li>
|
||||
<li>Specify the label (name) of the with -l, or accept the
|
||||
default label.</li>
|
||||
<li>Depending on your card and profile option, you will be prompted
|
||||
to
|
||||
provide your SO PIN and/or PIN; if you don't want to be prompted, add
|
||||
them to the command line with --so-pin <SOPIN> and/or --pin
|
||||
<PIN>.</li>
|
||||
</ul>
|
||||
<h3>* Add data</h3>
|
||||
<span style="font-style: italic;">pkcs15-init
|
||||
-W <datafile> {-i <ID>} {-l <label>}</span><br>
|
||||
<ul>
|
||||
<li>The datafile is stored "as is" onto the card.</li>
|
||||
<li>Specify the ID of the data with -i, or accept the default ID.</li>
|
||||
<li>Specify the label (name) of the with -l, or accept the
|
||||
default label.</li>
|
||||
<li>Depending on your card and profile option, you will be prompted
|
||||
to
|
||||
provide your SO PIN and/or PIN; if you don't want to be prompted, add
|
||||
them to the command line with --so-pin <SOPIN> and/or --pin
|
||||
<PIN>.</li>
|
||||
</ul>
|
||||
<h2>4. Other tools</h2>
|
||||
<h3>* SSL-engines</h3>
|
||||
These libraries can be loaded in OpenSSL so you can do a certificate
|
||||
request with the openssl tool; the signature on the certificate request
|
||||
will
|
||||
then be made with the smart card. The result can then be sent to a CA
|
||||
for certification, the resulting certificate can be put on the card
|
||||
with
|
||||
pkcs15-init or pkcs11-tool.<br>
|
||||
<ul>
|
||||
<li>Run openssl</li>
|
||||
<li>On the openssl command prompt, type<br>
|
||||
<span style="font-style: italic;">engine dynamic
|
||||
-pre SO_PATH:engine_pkcs11 -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD</span><br>
|
||||
or<br>
|
||||
<span style="font-style: italic;">engine dynamic
|
||||
-pre
|
||||
SO_PATH:engine_opensc -pre ID:opensc -pre LIST_ADD:1 -pre LOAD</span><br>
|
||||
depending on which one of the 2 engines (pkcs11 or opensc) you want to
|
||||
use.</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>Then type (on the openssl command prompt)<br>
|
||||
<span style="font-style: italic;">req -engine
|
||||
pkcs11 -new -key <ID> -keyform engine -out <cert_req></span><br>
|
||||
or<span style="font-style: italic;"><br>
|
||||
</span><span style="font-style: italic;">
|
||||
req -engine opensc -new -key <ID> -keyform engine -out
|
||||
<cert_req></span><br>
|
||||
in which ID is the slot+ID in the following format:<br>
|
||||
<span style="font-style: italic;">[slot_<slotID>][-][id_<ID>]</span>,
|
||||
e.g. <span style="font-style: italic;">id_45</span> or <span style="font-style: italic;">slot_0-id_45</span><br>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>* pkcs11-tool and Mozilla/Netscape</h3>
|
||||
You can use the OpenSC pkcs11 library to generate a keypair in Mozilla
|
||||
or Netscape, and let the browser generate a certificate request that
|
||||
is sent to an on-line CA to issue and send you a certificate that is
|
||||
then added to the card.<br>
|
||||
<br>
|
||||
Just go to an online CA (Globalsign, Thawte, ...) and follow their
|
||||
guidelines. Because such a request either costs you or at least
|
||||
requires you to provide a valid mail address, it is advisable to first
|
||||
try you card with "<span style="font-weight: bold;">pkcs11-tool
|
||||
--moz-cert
|
||||
<cert_file_in_der_format> --login</span>".<br>
|
||||
<br>
|
||||
NOTE: This can only be done with the onepin profile option (because the
|
||||
browser won't ask for an SO PIN, only for the user PIN).<br>
|
||||
<br>
|
||||
<h2>5. Card-specific issues</h2>
|
||||
<div style="text-align: center;"><span style="font-style: italic;">Experience
|
||||
is that marvelous thing that enables you to recognize</span><br style="font-style: italic;">
|
||||
<span style="font-style: italic;">a mistake when you make it again. --
|
||||
Franklin P. Jones</span><br>
|
||||
</div>
|
||||
<br>
|
||||
<span style="font-weight: bold;">Cryptoflex:</span><br>
|
||||
<ul>
|
||||
<li>DFs and EFs in a DF have to be deleted in reverse order of
|
||||
creation.<br>
|
||||
OpenSC relies on this fact for security, but also has some downsides.
|
||||
For example, if you did a "pkcs15-init -C" and then added some EFs or
|
||||
DFs in the MF, you won't be able to do a "pkcs15-init -E" afterwards to
|
||||
remove the PKCS15 DF (5015). So you'll first have to manually remove
|
||||
all EFs/DFs you created in the MF before being able remove the pkcs15
|
||||
DF.<br>
|
||||
</li>
|
||||
</ul>
|
||||
<span style="font-weight: bold;">Starcos SPK 2.3:</span><br>
|
||||
<ul>
|
||||
<li>Due to the way Starcos SPK 2.3 manages access rights it is
|
||||
necessary to manually call "pkcs15-init --finalize" after card
|
||||
personalization if no SO-PIN has been specified. Once the card has been
|
||||
finalized it is no possible to add new private/secrets keys or PINs. If
|
||||
a SO-PIN is used the card will automatically be finalized after the
|
||||
SO-PIN has been stored.</li>
|
||||
<li>If an SO-PIN is used and if there is enough space in the key file
|
||||
left, then the owner of the SO-PIN can access/use every protected item
|
||||
by creating a PIN for the necessary state.</li>
|
||||
</ul>
|
||||
<br>
|
||||
</body></html>
|
3
opensc-0.11.1.tar.bz2
Normal file
3
opensc-0.11.1.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:07ba76a02c5e470d41bb062255e9f3ac32d0ad6a571ccdacaa4d0161efe07adf
|
||||
size 951680
|
156
opensc.changes
Normal file
156
opensc.changes
Normal file
@ -0,0 +1,156 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 2 18:49:35 CEST 2006 - sbrabec@suse.cz
|
||||
|
||||
- Updated to version 0.11.1:
|
||||
* Update for piv pkcs#15 emulation
|
||||
* Improved TCOS driver for Uni Giesen Card
|
||||
* Handle size_t printf with "%lu" and (unsigned long) cast
|
||||
* Add support for d-trust cards / improve micardo 2.1 driver
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu May 25 16:13:02 CEST 2006 - sbrabec@suse.cz
|
||||
|
||||
- Fixed build for old SuSE Linux versions.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu May 11 13:00:00 CEST 2006 - sbrabec@suse.cz
|
||||
|
||||
- Fixed devel dependencies.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed May 10 16:58:12 CEST 2006 - sbrabec@suse.cz
|
||||
|
||||
- Updated to version 0.11.0.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 25 21:39:06 CET 2006 - mls@suse.de
|
||||
|
||||
- converted neededforbuild to BuildRequires
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 5 02:05:11 CET 2006 - ro@suse.de
|
||||
|
||||
- added unpackaged so-links to devel filelist
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 25 15:30:04 CEST 2005 - rhafer@suse.de
|
||||
|
||||
- added LDAP_DEPRECATED to CFLAGS to build correctly with·
|
||||
OpenLDAP 2.3
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 2 12:56:14 CEST 2005 - okir@suse.de
|
||||
|
||||
- Removed +x permissions on opensc.conf (#114849)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jul 14 16:11:56 CEST 2005 - okir@suse.de
|
||||
|
||||
- Updated to latest upstream version
|
||||
- Added missing documentation files (#75425)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 4 11:06:48 CET 2005 - meissner@suse.de
|
||||
|
||||
- fixed gcc4 compilation.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 21 14:43:23 CET 2005 - okir@suse.de
|
||||
|
||||
- Updated to latest upstream version (0.9.4)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 18 15:49:34 CET 2004 - ro@suse.de
|
||||
|
||||
- use kerberos-devel-packages
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 19 14:06:10 CEST 2004 - adrian@suse.de
|
||||
|
||||
- fix file list
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 12 17:26:31 CEST 2004 - adrian@suse.de
|
||||
|
||||
- update to version 0.8.1
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 19 11:10:13 CET 2004 - okir@suse.de
|
||||
|
||||
- Fixed permissions and path names of some include files (#36432)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 16 13:19:16 CET 2004 - kukuk@suse.de
|
||||
|
||||
- Add pam-devel to neededforbuild
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Jan 10 15:47:57 CET 2004 - adrian@suse.de
|
||||
|
||||
- add %run_ldconfig and %defattr
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 4 11:00:27 CEST 2003 - okir@suse.de
|
||||
|
||||
- Build fixes for x86_64/ppc64
|
||||
- use a version string other than "CVS" (#28423)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 1 12:04:29 CEST 2003 - okir@suse.de
|
||||
|
||||
- Updated to most recent upstream snapshot
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jun 12 13:28:31 CEST 2003 - kukuk@suse.de
|
||||
|
||||
- Fix filelist and permissions
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 4 00:39:12 CEST 2003 - ro@suse.de
|
||||
|
||||
- added rest of static libs to devel filelist
|
||||
- remove unpackaged files from buildroot
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 15 17:34:58 CET 2003 - ro@suse.de
|
||||
|
||||
- use sasl2
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 5 11:22:44 CET 2002 - okir@suse.de
|
||||
|
||||
- fixed x86_64 build problem
|
||||
- updated to latest upstream
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 29 10:01:14 CET 2002 - okir@suse.de
|
||||
|
||||
- updated to current CVS snapshot
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 9 21:35:43 CEST 2002 - okir@suse.de
|
||||
|
||||
- added missing libs to files list
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jul 4 17:48:11 CEST 2002 - ro@suse.de
|
||||
|
||||
- added heimdal-devel to neededforbuild to make libtool happy
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 28 17:34:49 CEST 2002 - schwab@suse.de
|
||||
|
||||
- Fix bootstrap script.
|
||||
- Use correct libtool macros.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 27 19:10:07 CEST 2002 - sf@suse.de
|
||||
|
||||
- @libdir@ added to Makefile.am to use correct dirs for
|
||||
*/lib */lib64
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 30 16:05:12 CEST 2002 - okir@suse.de
|
||||
|
||||
- Initial check-in
|
||||
|
193
opensc.spec
Normal file
193
opensc.spec
Normal file
@ -0,0 +1,193 @@
|
||||
#
|
||||
# spec file for package opensc (Version 0.11.1)
|
||||
#
|
||||
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# This file and all modifications and additions to the pristine
|
||||
# package are under the same license as the package itself.
|
||||
#
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
|
||||
Name: opensc
|
||||
BuildRequires: openssl-devel pkgconfig readline-devel xorg-x11-devel
|
||||
%if %suse_version > 1000
|
||||
BuildRequires: libassuan pcsc-lite-devel
|
||||
%endif
|
||||
%if %suse_version > 1010
|
||||
BuildRequires: openct-devel
|
||||
%endif
|
||||
URL: http://www.opensc-project.org/opensc/
|
||||
Version: 0.11.1
|
||||
Release: 1
|
||||
Group: Hardware/Other
|
||||
Summary: OpenSC Smart Card Library
|
||||
License: LGPL
|
||||
Requires: pcsc-lite
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Source: opensc-%{version}.tar.bz2
|
||||
Source1: http://www.opensc.org/files/doc/init_perso_guide.html
|
||||
AutoReqProv: on
|
||||
|
||||
%description
|
||||
OpenSC provides a set of libraries and utilities to access smart cards.
|
||||
Its main focus is on cards that support cryptographic operations. It
|
||||
facilitates their use in security applications such as mail encryption,
|
||||
authentication, and digital signature. OpenSC implements the PKCS#11
|
||||
API so applications supporting this API, such as Mozilla Firefox and
|
||||
Thunderbird, can use it. OpenSC implements the PKCS#15 standard and
|
||||
aims to be compatible with every software that does so, too.
|
||||
|
||||
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Juha Yrjölä <jyrjola@cc.hut.fi>
|
||||
Antti Tapaninen <aet@cc.hut.fi>
|
||||
Timo Teräs <timo.teras@iki.fi>
|
||||
Olaf Kirch <okir@suse.de>
|
||||
|
||||
%package devel
|
||||
Group: Development/Libraries/Other
|
||||
Summary: Additional files needed for OpenSC development
|
||||
Requires: %{name} = %{version} glibc-devel openct-devel openssl-devel pcsc-lite-devel
|
||||
|
||||
%description devel
|
||||
This package contains files required to develop applications using the
|
||||
OpenSC framework.
|
||||
|
||||
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Juha Yrjölä <juha.yrjola@iki.fi>
|
||||
Antti Tapaninen <aet@cc.hut.fi>
|
||||
Timo Teräs <timo.teras@iki.fi>
|
||||
Olaf Kirch <okir@caldera.de>
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
rm -f aclocal/libtool.m4
|
||||
libtoolize --force
|
||||
#./bootstrap
|
||||
CFLAGS="$RPM_OPT_FLAGS" \
|
||||
./configure --prefix=/usr \
|
||||
--sysconfdir=%{_sysconfdir} \
|
||||
--mandir=%{_mandir} \
|
||||
--libdir=%{_libdir}
|
||||
make %{?jobs:-j %jobs}
|
||||
|
||||
%install
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
# Install opensc.conf
|
||||
mkdir -p $RPM_BUILD_ROOT/etc
|
||||
install -m 644 etc/opensc.conf $RPM_BUILD_ROOT/etc
|
||||
# Copy init_perso.html to docs so it's installed
|
||||
cp %{SOURCE1} .
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%post
|
||||
%run_ldconfig
|
||||
|
||||
%postun
|
||||
%run_ldconfig
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc COPYING NEWS README doc init_perso_guide.html
|
||||
%config /etc/opensc.conf
|
||||
/usr/bin/*-crypt
|
||||
/usr/bin/*-explorer
|
||||
/usr/bin/*-info
|
||||
/usr/bin/*-init
|
||||
/usr/bin/*-tool
|
||||
/usr/bin/eidenv
|
||||
%_libdir/*.so.*
|
||||
# Note: Required by ltdl:
|
||||
%_libdir/*.la
|
||||
%_libdir/*.so
|
||||
/usr/share/opensc
|
||||
%_mandir/man?/*
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
/usr/bin/*-config
|
||||
/usr/include/opensc
|
||||
%_libdir/*.a
|
||||
%_libdir/pkgconfig/*.pc
|
||||
|
||||
%changelog -n opensc
|
||||
* Mon Oct 02 2006 - sbrabec@suse.cz
|
||||
- Updated to version 0.11.1:
|
||||
* Update for piv pkcs#15 emulation
|
||||
* Improved TCOS driver for Uni Giesen Card
|
||||
* Handle size_t printf with "%%lu" and (unsigned long) cast
|
||||
* Add support for d-trust cards / improve micardo 2.1 driver
|
||||
* Thu May 25 2006 - sbrabec@suse.cz
|
||||
- Fixed build for old SuSE Linux versions.
|
||||
* Thu May 11 2006 - sbrabec@suse.cz
|
||||
- Fixed devel dependencies.
|
||||
* Wed May 10 2006 - sbrabec@suse.cz
|
||||
- Updated to version 0.11.0.
|
||||
* Wed Jan 25 2006 - mls@suse.de
|
||||
- converted neededforbuild to BuildRequires
|
||||
* Thu Jan 05 2006 - ro@suse.de
|
||||
- added unpackaged so-links to devel filelist
|
||||
* Tue Oct 25 2005 - rhafer@suse.de
|
||||
- added LDAP_DEPRECATED to CFLAGS to build correctly with·
|
||||
OpenLDAP 2.3
|
||||
* Fri Sep 02 2005 - okir@suse.de
|
||||
- Removed +x permissions on opensc.conf (#114849)
|
||||
* Thu Jul 14 2005 - okir@suse.de
|
||||
- Updated to latest upstream version
|
||||
- Added missing documentation files (#75425)
|
||||
* Fri Mar 04 2005 - meissner@suse.de
|
||||
- fixed gcc4 compilation.
|
||||
* Fri Jan 21 2005 - okir@suse.de
|
||||
- Updated to latest upstream version (0.9.4)
|
||||
* Thu Nov 18 2004 - ro@suse.de
|
||||
- use kerberos-devel-packages
|
||||
* Mon Jul 19 2004 - adrian@suse.de
|
||||
- fix file list
|
||||
* Mon Jul 12 2004 - adrian@suse.de
|
||||
- update to version 0.8.1
|
||||
* Fri Mar 19 2004 - okir@suse.de
|
||||
- Fixed permissions and path names of some include files (#36432)
|
||||
* Fri Jan 16 2004 - kukuk@suse.de
|
||||
- Add pam-devel to neededforbuild
|
||||
* Sat Jan 10 2004 - adrian@suse.de
|
||||
- add %%run_ldconfig and %%defattr
|
||||
* Mon Aug 04 2003 - okir@suse.de
|
||||
- Build fixes for x86_64/ppc64
|
||||
- use a version string other than "CVS" (#28423)
|
||||
* Fri Aug 01 2003 - okir@suse.de
|
||||
- Updated to most recent upstream snapshot
|
||||
* Thu Jun 12 2003 - kukuk@suse.de
|
||||
- Fix filelist and permissions
|
||||
* Wed Jun 04 2003 - ro@suse.de
|
||||
- added rest of static libs to devel filelist
|
||||
- remove unpackaged files from buildroot
|
||||
* Wed Jan 15 2003 - ro@suse.de
|
||||
- use sasl2
|
||||
* Thu Dec 05 2002 - okir@suse.de
|
||||
- fixed x86_64 build problem
|
||||
- updated to latest upstream
|
||||
* Fri Nov 29 2002 - okir@suse.de
|
||||
- updated to current CVS snapshot
|
||||
* Fri Aug 09 2002 - okir@suse.de
|
||||
- added missing libs to files list
|
||||
* Thu Jul 04 2002 - ro@suse.de
|
||||
- added heimdal-devel to neededforbuild to make libtool happy
|
||||
* Fri Jun 28 2002 - schwab@suse.de
|
||||
- Fix bootstrap script.
|
||||
- Use correct libtool macros.
|
||||
* Mon May 27 2002 - sf@suse.de
|
||||
- @libdir@ added to Makefile.am to use correct dirs for
|
||||
*/lib */lib64
|
||||
* Tue Apr 30 2002 - okir@suse.de
|
||||
- Initial check-in
|
Loading…
Reference in New Issue
Block a user