OpenPGP kulcsgenerálás az eszközön¶
Compatible Nitrokeys |
|||||||
|---|---|---|---|---|---|---|---|
✓ active |
⨯ inactive |
⨯ inactive |
✓ active |
⨯ inactive |
✓ active |
✓ active |
⨯ inactive |
A következő utasítások az OpenPGP kulcsok generálását ismertetik közvetlenül a Nitrokey-n. Ez a GnuPG parancssori felületének használatával történik. Ezért a GnuPG-nek telepítve kell lennie a rendszerén. A GnuPG legújabb verziója Windowsra itt, MacOS-re pedig itt található. A Linux rendszerek felhasználói a GnuPG-t a csomagkezelő segítségével telepítsék.
Megjegyzés
These instructions are based on GnuPG version 2.2.6 or higher. Some Linux Distributions have an older version installed. In this case please choose a different method as listed here or install a newer version if possible.
Kulcsgenerálás¶
The following descriptions explain the basic key generation on-device via GnuPG’s command line interface. The default behaviour is to generate RSA keys of 2048 bit size. If you want to change the key algorithm and length, have a look at the next section first.
Nyisson egy parancssort, és írja be a gpg2 --card-edit parancsot.
To open the Windows command line please push the Windows-key and R-key. Now type cmd.exe in the text field and hit enter. To open a Terminal on macOS or GNU/Linux please use the application search (e.g. spotlight on macOS).
> gpg2 --card-edit
Reader ...........: 20A0:4108:0000320E0000000000000000:0
Application ID ...: D27600012401020100050000320E0000
Version ..........: 2.1
Manufacturer .....: ZeitControl
Serial number ....: 0000320E
Name of cardholder: [not set]
Language prefs ...: de
Sex ..............: unspecified
URL of public key : [not set]
Login data .......: [not set]
Signature PIN ....: forced
Key attributes ...: rsa2048 rsa2048 rsa2048
Max. PIN lengths .: 32 32 32
PIN retry counter : 3 0 3
Signature counter : 0
Signature key ....: [none]
Encryption key....: [none]
Authentication key: [none]
General key info..: [none]
gpg/card>
Most már a GnuPG interaktív felületén van. Aktiváld az admin parancsokat a admin<x> segítségével, majd utána a generate segítségével indítsd el a kulcsok generálását.
gpg/card> admin
Admin commands are allowed
gpg/card> generate
Make off-card backup of encryption key? (Y/n) n
Please note that the factory settings of the PINs are
PIN = '123456' Admin PIN = '12345678'
You should change them using the command --change-pin
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0)
Key does not expire at all
Is this correct? (y/N) y
GnuPG needs to construct a user ID to identify your key.
Real name: Jane Doe
Email address: jane@example.com
Comment:
You selected this USER-ID:
"Jane Doe <jane@doecom>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
gpg: key 817E149CA002B92F marked as ultimately trusted
gpg: revocation certificate stored as '/home/nitrokey//.gnupg/openpgp-revocs.d/E62F445E8BB4B5085C031F5381
7E149CA002B92F.rev'
public and secret key created and signed.
gpg/card>
</jane@doe.com></n></n></n></n>
Kérem, ne készítsen a javasolt kártyán kívüli biztonsági másolatot. Ez a „biztonsági másolat” csak a titkosítási kulcsot menti, az aláírási és hitelesítési kulcsokat nem. Az eszköz elvesztése esetén nem tudja visszaállítani a teljes kulcskészletet. Tehát egyrészt nem teljes biztonsági mentés (használja helyette a ezeket az utasításokat, ha szüksége van rá), másrészt pedig azt kockáztatja, hogy valaki más is birtokába kerülhet a titkosítási kulcsának. Az eszközön történő kulcsgenerálás előnye, hogy a kulcsokat biztonságosan tárolja. Ezért javasoljuk, hogy hagyja ki ezt a félkészletet.
Most már egy teljes kulcskészlet van a készülékén, amelyet az oldalunkon felsorolt különböző alkalmazásokhoz használhat. Írja be a quit és nyomja meg az enter billentyűt a kilépéshez.
Kulcsattribútumok módosítása¶
Ez a szakasz a kulcsattribútumok megváltoztatásáról szól. Ha az alapértelmezett értékeket szeretné használni, akkor a következő szakaszban folytathatja.
Nyisson egy parancssort, és írja be a gpg2 --card-edit --expert parancsot.
> gpg2 --card-edit --expert
Reader ...........: 20A0:4108:0000320E0000000000000000:0
Application ID ...: D27600012401020100050000320E0000
Version ..........: 2.1
Manufacturer .....: ZeitControl
Serial number ....: 0000320E
Name of cardholder: [not set]
Language prefs ...: de
Sex ..............: unspecified
URL of public key : [not set]
Login data .......: [not set]
Signature PIN ....: forced
Key attributes ...: rsa2048 rsa2048 rsa2048
Max. PIN lengths .: 32 32 32
PIN retry counter : 3 0 3
Signature counter : 0
Signature key ....: [none]
Encryption key....: [none]
Authentication key: [none]
General key info..: [none]
Most már a GnuPG interaktív felületén van. Amint a fenti „Key attributes” mezőben láthatod, az alapértelmezett érték rsa2048 van beállítva. A módosításhoz aktiváld az admin parancsokat a admin segítségével, és utána használd a key-attr-t a kulcsok attribútumainak módosításához.
gpg/card> admin
Admin commands are allowed
gpg/card> key-attr
Changing card key attribute for: Signature key
Please select what kind of key you want:
(1) RSA
(2) ECC
Your selection? 1
What keysize do you want? (2048) 4096
The card will now be re-configured to generate a key of 4096 bits
Changing card key attribute for: Encryption key
Please select what kind of key you want:
(1) RSA
(2) ECC
Your selection? 1
What keysize do you want? (2048) 4096
The card will now be re-configured to generate a key of 4096 bits
Changing card key attribute for: Authentication key
Please select what kind of key you want:
(1) RSA
(2) ECC
Your selection? 1
What keysize do you want? (2048) 4096
The card will now be re-configured to generate a key of 4096 bits
Az egyes kulcsok (azaz az aláírás, a titkosítási és a hitelesítési kulcs) attribútumát kiválaszthatja. A legtöbb ember minden kulcshoz ugyanazokat az attribútumokat fogja használni. Írd be a list<x>, hogy lásd az eredményeket (nézd meg a „Key attributes” mezőt, ahol most rsa4096 szerepel).
gpg/card> list
Reader ...........: 20A0:4108:0000320E0000000000000000:0
Application ID ...: D27600012401020100050000320E0000
Version ..........: 2.1
Manufacturer .....: ZeitControl
Serial number ....: 0000320E
Name of cardholder: [not set]
Language prefs ...: de
Sex ..............: unspecified
URL of public key : [not set]
Login data .......: [not set]
Signature PIN ....: forced
Key attributes ...: rsa4096 rsa4096 rsa4096
Max. PIN lengths .: 32 32 32
PIN retry counter : 3 0 3
Signature counter : 0
Signature key ....: [none]
Encryption key....: [none]
Authentication key: [none]
General key info..: [none]
Írja be a quit<x> és nyomja meg az enter billentyűt a kilépéshez, vagy folytassa közvetlenül az előző résszel, hogy ténylegesen létrehozza a kulcsokat az imént beállított kulcsattribútumokkal.
A következő táblázat szemlélteti, hogy melyik algoritmus melyik eszközön használható.
Algorithm |
Indítsa el a oldalt. |
Pro + Storage |
Pro 2 + Storage 2 |
|---|---|---|---|
rsa1024 |
✓ |
✓ |
|
rsa2048 |
✓ |
✓ |
✓ |
rsa3072 |
✓ |
✓ |
|
rsa4096 |
✓ |
✓ |
|
curve25519 (ECC) |
✓ |
||
NIST (ECC) |
✓ |
✓ |
|
Brainpool (ECC) |
✓ |
||
secp256k1 |
✓ |
Nyilvános kulcs exportálása és kulcsszerver-használat¶
Bár a Nitrokey-t a kulcsok generálása után azonnal elkezdheti használni a rendszerén, a nyilvános kulcsot minden olyan rendszerre importálnia kell, amelyen használni szeretné a Nitrokey-t. Így a felkészüléshez két lehetőséged van: Vagy elmented a nyilvános kulcsot bárhová, ahol szeretnéd, és egy másik rendszeren használod, vagy elmented a nyilvános kulcsot egy weblapon/kulcsszerverre.
Nyilvános kulcsfájl generálása¶
A nyilvános kulcsod egyszerű fájljához egyszerűen használhatod a gpg2 --armor --export keyID > pubkey.asc parancsot. Használd az ujjlenyomatot „keyID”-ként (nézd meg a gpg -K címet), vagy csak az e-mail címedet használd azonosítóként.
You can carry this file with you or send it to anyone who you like. This file is not secret at all. If you want to use the Nitrokey on another system, you first import this public key via gpg2 --import pubkey.asc and then types gpg2 --card-status so that the system knows where to look for this key. That’s all.
A nyilvános kulcs feltöltése¶
Ha nem szeretne nyilvános kulcsfájlt magával vinni, akkor feltöltheti azt a keyserverre. Ezt a gpg --keyserver search.keyserver.net --send-key keyID beírásával teheti meg. Ha egy másik gépet használsz, akkor egyszerűen importálhatod a <x id=”237”><</x>`gpg –keyserver search.keyserver.net –recv-key keyID`` használatával.
Another possibility is to change the URL setting on your card.
Run gpg --card-edit again and first set the URL where the key is situated (e.g. on the keyserver or on your webpage etc.) via the url command.
From now on you can import the key on another system by just using the fetch command within the gpg --card-edit environment.