Phần mềm v2 SoftHSMv2 ហ្វេសប៊ុក
Hướng dẫn chi tiết đồng bộ từ docs Cloudflare — mỗi section có backlink tới đúng vị trí trên trang gốc. Detailed guide synced from Cloudflare docs — each section links to the matching anchor on the official page. មគ្គុទ្ទេសក៍លម្អិតធ្វើសមកាលពី docs Cloudflare — ផ្នែកនីមួយៗមានតំណទៅទីតាំងត្រូវគ្នានៅទំព័រផ្លូវការ។
← Danh mục ← Catalog ← បញ្ជីGiải thích nhanh Quick context បរិបទរហ័ស
Thuộc nhóm Application Services — tập trung bảo vệ, tăng tốc và vận hành ứng dụng/web phía trước origin. Tutorial «SoftHSMv2» giúp bạn làm quen luồng triển khai thật — phù hợp đọc trước khi mở tài liệu gốc tiếng Anh. Docs gốc chia khoảng 4 bước chính; bản tóm tắt dưới đây giúp bạn nắm khung trước khi làm theo từng lệnh.
Learn how to use Keyless SSL with SoftHSMv2.
តើធ្វើដូចម្តេចដើម្បីប្រើ Keyless SSL ជាមួយ SoftHSMv2 ។
Lưu ý Note ចំណាំ
Lưu ý trước khi làm Notes before you start ចំណាំមុនពេលចាប់ផ្តើម
- Đây là bản tóm tắt trên Orange Cloud Learning Hub — không thay thế tài liệu chính thức.
- Luôn mở liên kết «Tài liệu gốc» bên dưới khi cần lệnh CLI, snippet code và ảnh minh họa đầy đủ.
- Docs Cloudflare cập nhật thường xuyên — đối chiếu ngày «Rà soát lần cuối» trên trang gốc khi triển khai production.
- This is a summary on Orange Cloud Learning Hub — it does not replace the official documentation.
- Open the Official docs link below for CLI commands, code snippets, and full screenshots.
- Cloudflare docs change frequently — verify the Last reviewed date on the official page before production use.
- នេះគឺជាការបញ្ជាក់អំពី Orange Cloud Learning Hub — វាគឺជាការផ្លាស់ប្តូរនៃឯកសារផ្លូវការ។
- ចុចតំណភ្ជាប់ Docs Official នៅខាងក្រោមសម្រាប់ការបញ្ជា CLI, សៀវភៅកូដនិងរូបថតពេញលេញ។
- Cloudflare បានផ្លាស់ប្តូរជាធម្មតានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅ។
Overview Overview Overview
Phần «Tổng quan» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "Overview" section below — open the official docs link for full screenshots and configuration tabs.
អានផ្នែក «Overview» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។
1.Điều Cài đặt và cấu hình SoftHSMv2 1. Install and configure SoftHSMv2 1 ។ ការដំឡើងនិងការកំណត់ SoftHSMv2
Phần «Cài đặt và configure SoftHSMv2» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "1. Install and configure SoftHSMv2" section below — open the official docs link for full screenshots and configuration tabs.
អានផ្នែក «1 ។ ការដំឡើងនិងការកំណត់ SoftHSMv2» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។
/var/lib/softhsm/tokens. Chúng tôi cũng cần cấp quyền cho nhóm softhsm cho thư mục này vì đây là cách người dùng keyless sẽ access thư mục này./var/lib/softhsm/tokens. We also need to give the softhsm group permission to this directory as this is how the keyless user will access this directory./var/lib/softhsm/tokens ។ យើងក៏ត្រូវការផ្តល់អនុញ្ញាតដល់ក្រុម softhsm ទៅមេឡិចត្រូនិកនេះដូច្នេះដូច្នេះអ្នកប្រើ keyless នឹង access មេឡិចត្រូនិកនេះ។sudo apt-get install -y softhsm2 opensc
#...
cat <<EOF | sudo tee /etc/softhsm/softhsm2.conf
directories.tokendir = /var/lib/softhsm/tokens
objectstore.backend = file
log.level = DEBUG
slots.removable = false
EOF
sudo mkdir /var/lib/softhsm/tokens
sudo chown root:softhsm $_
sudo chmod 0770 /var/lib/softhsm/tokens
sudo usermod -G softhsm keyless
sudo usermod -G softhsm $(whoami)
echo 'export SOFTHSM2_CONF=/etc/softhsm/softhsm2.conf' | tee -a ~/.profile
source ~/.profile 2.Đối với Tạo token và private keys, và tạo CSR 2. Create a token and private keys, and generate CSRs 2 ។ បានបង្កើត token និង private keys និងបង្កើត CSRs
Phần «Tạo token và private keys, và generate CSRs» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "2. Create a token and private keys, and generate CSRs" section below — open the official docs link for full screenshots and configuration tabs.
អានផ្នែក «2 ។ បានបង្កើត token និង private keys និងបង្កើត CSRs» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។
test-token và bảo mật nó với mã PIN 1234. Trong khe này, chúng tôi sẽ lưu trữ các phím RSA cho chứng chỉ SSL của chúng tôi cho keyless-softhsm.example.com.test-token and secure it with a PIN of 1234. In this slot we’ll store the RSA keys for our SSL certificates for keyless-softhsm.example.com.test-token និងការពារវាជាមួយនឹង PIN នៃ 1234 ។ ក្នុងកំណត់នេះយើងនឹងរក្សាទុកគោលដៅ RSA សម្រាប់វិញ្ញាបនប័ត្រ SSL របស់យើងសម្រាប់ keyless-softhsm.example.com ។sudo -u keyless softhsm2-util --init-token --slot 0 --label test-token --pin 1234 --so-pin 4321 The token has been initialized. cat <<EOF | tee csr.json
{
"hosts": [
"keyless-softhsm.example.com"
],
"CN": "keyless-softhsm.example.com",
"key": {
"algo": "rsa",
"size": 2048
},
"names": [{
"C": "US",
"L": "San Francisco",
"O": "TLS Fun",
"OU": "Technical Operations",
"ST": "California"
}]
}
EOF
cfssl genkey csr.json | cfssljson -bare certificate 2018/08/12 00:52:22 [INFO] generate received request
2018/08/12 00:52:22 [INFO] received CSR
2018/08/12 00:52:22 [INFO] generating key: rsa-2048
2018/08/12 00:52:22 [INFO] encoded CSR 3 Cái Chuyển đổi và nhập khẩu khóa 3. Convert and import the key 3 ។ ការផ្លាស់ប្តូរនិងនាំចូលគោលបំណង
Phần «Chuyển đổi và import key» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "3. Convert and import the key" section below — open the official docs link for full screenshots and configuration tabs.
អានផ្នែក «3 ។ ការផ្លាស់ប្តូរនិងនាំចូលគោលបំណង» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in certificate-key.pem -out certificate-key.p8
sudo chown keyless certificate-key.p8
sudo -u keyless softhsm2-util --pin 1234 --import ./certificate-key.p8 --token test-token --id a000 --label rsa-privkey Found slot 915669571 with matching token label.
The key pair has been imported. pkcs11-tool để xác nhận các đối tượng đã được lưu trữ thành công trong token.pkcs11-tool to confirm the objects have been successfully stored in the token.pkcs11-tool ដើម្បីបញ្ជាក់ថាអតិថិជនទាំងនេះត្រូវបានរក្សាទុកយ៉ាងជោគជ័យនៅក្នុង token ។sudo -u keyless pkcs11-tool --module /usr/lib/softhsm/libsofthsm2.so -l -p 1234 --token test-token --list-objects Public Key Object; RSA 2048 bits
label: rsa-privkey
ID: a000
Usage: verify
Private Key Object; RSA
label: rsa-privkey
ID: a000
Usage: sign Bốn Thay đổi tập tin cấu hình không gokeyless của bạn và khởi động lại dịch vụ 4. Modify your gokeyless config file and restart the service 4 ។ ការផ្លាស់ប្តូរឯកសារ Config Gokeyless របស់អ្នកនិងចាប់ផ្តើមសេវាកម្មថ្មី
Phần «Modify your gokeyless config file và restart service» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "4. Modify your gokeyless config file and restart the service" section below — open the official docs link for full screenshots and configuration tabs.
អានផ្នែក «4 ។ ការផ្លាស់ប្តូរឯកសារ Config Gokeyless របស់អ្នកនិងចាប់ផ្តើមសេវាកម្មថ្មី» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។
id đề cập đến ID thập phân mà bạn đã cung cấp cho tuyên bố nhập softhsm2-util; chúng tôi đã sử dụng a000 để nó được mã hóa là %a0%00. module-path sẽ thay đổi một chút dựa trên bản phân phối Linux bạn đang sử dụng. Trên Debian, nó nên là /usr/lib/softhsm/libsofthsm2.so.id refers to the hexadecimal ID you provided to the softhsm2-util import statement; we used a000 so it is encoded as %a0%00. The module-path will vary slightly based on the Linux distribution you are using. On Debian it should be /usr/lib/softhsm/libsofthsm2.so.id បានផ្លាស់ប្តូរទៅអ៊ីនធឺណិត hexadecimal ដែលអ្នកបានផ្តល់នូវការបញ្ចូល softhsm2-util ។ យើងបានប្រើ a000 ដូច្នេះវាត្រូវបានកូដជា %a0%00 ។ module-path នឹងប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រែប្រ នៅលើ Debian វាគឺជា /usr/lib/softhsm/libsofthsm2.so ។/etc/keyless/gokeyless.yaml và ngay sau đó/etc/keyless/gokeyless.yaml and immediately after/etc/keyless/gokeyless.yaml ហើយបន្ទាប់ពីនេះprivate_key_stores:
- dir: /etc/keyless/keys - uri: pkcs11:token=test-token;id=%a0%00?module-path=/usr/lib/softhsm/libsofthsm2.so&pin-value=1234&max-sessions=1 gokeyless và xác minh nó đã bắt đầu thành công.gokeyless, and verify it started successfully.gokeyless, និងត្រួតពិនិត្យវាបានចាប់ផ្តើមយ៉ាងជោគជ័យ។sudo systemctl restart gokeyless.service
sudo systemctl status gokeyless.service -l {"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"/directory/","name":"Directory"}},{"@type":"ListItem","position":2,"item":{"@id":"/ssl/","name":"SSL/TLS"}},{"@type":"ListItem","position":3,"item":{"@id":"/ssl/keyless-ssl/","name":"Keyless SSL"}},{"@type":"ListItem","position":4,"item":{"@id":"/ssl/keyless-ssl/hardware-security-modules/","name":"Hardware security modules"}},{"@type":"ListItem","position":5,"item":{"@id":"/ssl/keyless-ssl/hardware-security-modules/softhsmv2/","name":"SoftHSMv2"}}]} Xem bản đầy đủ trên developers.cloudflare.com (ảnh, tab cấu hình). View the full guide on developers.cloudflare.com (images, config tabs). មើលមគ្គុទ្ទេសក៍ពេញលើ developers.cloudflare.com (រូបភាព, tab កំណត់)។
Tài liệu gốc ↗ Official docs ↗ ឯកសារផ្លូវការ ↗