เครื่องมือสำหรับนำเข้า Root Certificate Authority (Microsoft Windows)

From Prakai Nadee

บทนำ

Root Certificate Authority (Root CA) เป็นใบรับรองดิจิตอลของผู้ออกใบรับรองดิจิตอลสำหรับผู้อื่น ใช้ยืนยันความถูกต้องของใบรับรองดิจิตอลที่ใช้เข้ารหัสข้อมูลระหว่างเครื่อง เช่น ระหว่างเครื่องควบคุมเครือข่ายไร้สายกับเครื่อลูกข่ายไร้สาย (อ่านรายละเอียดเพิ่มเติมได้ที่ เชิญชวนนำเข้า RMUTI Root Certificate Authority ในเครื่องคอมพิวเตอร์) ปัญหาของการนำเข้า Root Certificate คือการนำเข้าไปยังระบบปฏิบัติการอย่างถูกตำแหน่ง (Certificate Store) คือ Trusted Root ซึ่งเป็นตำแหน่งการเก็บ Root Certificate ที่สามารถเรียกใช้ได้จากทุกโปรแกรม ทุกผู้ใช้ สามารถดำเนินการด้วยมือตามขั้นตอนที่อธิบายไว้ใน ขั้นตอนการนำเข้า RMUTI Root Certificate Authority สำหรับ Windows XP/Vista/7/2000/2003/2008

โปรแกรมสำหรับการนำเข้า Root Certificate คือ Certmgr.exe พัฒนาขึ้นโดย Microsoft สามารถดูรายละเอียดและดาวน์โหลดได้จาก Certmgr.exe (Certificate Manager Tool) หรือค้นหาได้จาก Google

การเรียกใช้โปรแกรม Certmgr.exe

สามารถเรียกใช้โปรแกรม Certmgr.exe ได้ 2 ช่องทาง คือ

  • เรียกใช้ผ่านโปรแกรม Windows Explorer หรือการเรียกใช้โปรแกรมแบบปกติบน Microsoft Windows นั่นเอง เมื่อเรียกใช้โปรแกรมแล้ว โปรแกรมจะทำงานโดยสื่อกับผู้ใช้เช่นเดียวกับโปรแกรมอื่นๆ ที่ทำงานบนระบบปฏิบัติการ Windows
  • เรียกใช้แบบ Command Line โดยเปิดหน้าต่าง Command Prompt ของ Microsoft Windows แล้วพิมพ์คำสั่ง Certmgr.exe เนื้อหาที่แนะนำต่อไปนี้ เป็นการเรียกใช้แบบ Command Line และสามารถนำวิธีการนี้ไปต่อยอดเป็นการสร้างสคริปต์สำเร็จรูปเพื่อการนำเข้า RMUTI Root Certificate Authrity ได้

การแสดงข้อความช่วยเหลือ

CertMgr.exe -h

Usage: CertMgr [options][-s [-r <location>][SourceStoreName]
                        [-s [-r <location>][DestinationStoreName]
Options:
 -add               Add certificates/CRLs/CTLs to a storeFile or a system store
 -del               Delete certificates/CRLs/CTLs from a storeFile or
                    a system store
 -put               Put an encoded certificate/CRL/CTL from a storeFile or
                    a system store to a file.  The file will be saved in X.509
                    format. -7 can be used to save the file in PKCS#7 format
 -s                 Indicate the store is a system store
 -r    <location>   The system store location
                        <currentUser|localMachine> Default to 'currentUser'
 -c                 Certificates in the store
 -crl               Certificates revocation lists(CRLs) in the store
 -ctl               Certificates trust lists(CTLs) in the store
 -v                 Verbose display of the certificates/CRLs/CTLs
 -all               All certificates/CRLs/CTLs in the store
 -n    <name>       Common name of the certificate
 -sha1 <thumbPrint> The sha1 hash of the certificate/CRLs/CTLs
 -7                 Save the destination store in PKCS# 7 format
 -e    <encode>     Certificate/CRL/CTL encoding type.
                    Default to X509_ASN_ENCODING
 -f    <flag>       CertStore open flags.  Meaningful only if -y is set
 -y    <provider>   CertStore provider name

การแสดงรายการ Certificate ใน Windows

หากต้องการแสดงรายการ Certificate ที่มีการติดตั้งอยู่แล้วใน Windows สามารถเรียกใช้คำสั่ง

CertMgr.exe -c -s -r localMachine root

การนำเข้า RMUTI Root Certificate Authority

ตัวอย่างคำสั่งต่อไปนี้เป็นการนำเข้า RMUTI Root Certificate Authority ที่บันทึกไว้ในไฟล์ RMUTi-CA.crt เข้าไปยังเป็นรายการ Certificate หลักของเครื่อง

CertMgr.exe -add -c RMUTi-CA.crt -s -r localMachine root

โดยสามารถดาวน์โหลด RMUTI Root Certificate Authority หรือไฟล์ RMUTi-CA.crt ได้จาก http://ca.rmuti.ac.th/ca.certs/RMUTi-CA.crt

ทดสอบผลการนำเข้า RMUTI Root Certificate Authority

หากต้องการทดสอบว่า การนำเข้า RMUTI Root Certificate Authority ได้สำเร็จหรือไม่ สามารถเรียกใช้ CertMgr.exe ในลักษณะของ Graphic Mode และค้นหา Certificate ชื่อ "RMUTi CA" ใน Trusted Root Certificate Authorities ได้ แต่หากต้องการตรวจสอบแบบสคริปต์ สามารถเรียกใช้คำสั่งดังนี้

CertMgr.exe -c -s -r localMachine root | find "RMUTi CA"

หากพบว่ามีการติดตั้ง RMUTi CA สำเร็จ จะได้ผลลัพธ์ของคำสั่งคล้ายกันดังนี้

[123]  [5,0] 2.5.4.3 (CN) RMUTi CA

หากไม่มีการติดตั้ง RMUTi CA ผลลัพธ์ของคำสั่งจะไม่มีข้อความใดๆ

อ้างอิง


MediaWiki spam blocked by CleanTalk.