๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๊ฐœ๋ฐœ/etc

[softhsm] windows์— softhsm2 ์„ค์น˜ ๋ฐ ์„ธํŒ…

by ynzu๐Ÿค 2021. 12. 6.
๋ฐ˜์‘ํ˜•

1. softhsm ๋‹ค์šด๋กœ๋“œ ๋ฐ ์„ค์น˜

 https://sourceforge.net/projects/softhsm4windows

 

SoftHSM for Windows

Download SoftHSM for Windows for free. SoftHSM installer for MS Windows. Binary builds and MSI installers of SoftHSM for MS Windows platform. Please visit project website - https://github.com/disig/SoftHSM2-for-Windows - for more information.

sourceforge.net

 

2. ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์„ธํŒ…

  • ์„ค์น˜ ๊ฒฝ๋กœ/README.txt ํŒŒ์ผ ์ฐธ์กฐ
  • ์‹œ์Šคํ…œ ๋ณ€์ˆ˜์— SOFTHSM2_CONF ๋ฐ PATH ์ถ”๊ฐ€
    SOFTHSM2_CONF = ์„ค์น˜๊ฒฝ๋กœ/etc/softhsm2.conf
    PATH = ์„ค์น˜๊ฒฝ๋กœ/lib

 

3. ์ดˆ๊ธฐํ™” ์ง„ํ–‰

    • ์„ค์น˜ ๊ฒฝ๋กœ/bin ์œผ๋กœ ์ด๋™
    • softhsm2-util.exe --init-token --slot 0 --label "๋ผ๋ฒจ๋ช…" ์‹คํ–‰
      • ์ž…๋ ฅํ•œ pin ๋ฒˆํ˜ธ ๋ฐ ์‹คํ–‰ ๊ฒฐ๊ณผ slot ๋ฒˆํ˜ธ๋ฅผ ๊ธฐ์–ตํ•˜๊ธฐ

 

4. config ์„ค์ •

  • ์„ค์น˜๊ฒฝ๋กœ/etc์— config ํŒŒ์ผ ์ƒ์„ฑ
  • ์˜ˆ์‹œ

  • name์€ Provider Name์œผ๋กœ SunPKCS11-SoftHSM2์ฒ˜๋Ÿผ "SunPKCS11-"๋ฅผ prefix๋กœ ์‚ฌ์šฉ-       config ํŒŒ์ผ์€ ์ž๋ฐ”์˜ provider ๋“ฑ๋ก ์‹œ ํ•„์š”ํ•˜๋‹ค.
  • Step 3์—์„œ ํš๋“ํ•œ slot ๋ฒˆํ˜ธ๋ฅผ slot์— ์„ธํŒ…ํ•œ๋‹ค.
  • config ํŒŒ์ผ์€ ์ž๋ฐ”์˜ provider ๋“ฑ๋ก ์‹œ ํ•„์š”ํ•˜๋‹ค.

 

5. provider ๋“ฑ๋ก

  • $JAVA_HOME/lib/security/java.security ์— provider๋ฅผ ๋“ฑ๋ก
  • ์˜ˆ์‹œ

  • Step 4์—์„œ ์ƒ์„ฑํ•œ config ํŒŒ์ผ์˜ ๊ฒฝ๋กœ๋ฅผ ์„ธํŒ…
  • provider ๋“ฑ๋ก์ด ์ œ๋Œ€๋กœ ๋๋Š”์ง€ ํ™•์ธํ•˜๋ ค๋ฉด ์•„๋ž˜ ์ฝ”๋“œ ์‹คํ–‰ํ›„ SubPKCS11์˜ ์œ ๋ฌด ์ฒดํฌ
Provider[] provs = Security.getProviders();
for (int provIter = 0; provIter < provs.length; provIter++) {
	System.out.println("["+(provIter+1)+"] : " + provs[provIter].getName());
}

 

 

728x90
๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€