다음 예는 JSSE 도구를 사용한 인증서 처리와 관련된 사용법을 보여줍니다.
자체 서명된 인증서를 RSA 키 알고리즘을 사용하여 JKS 유형의 keystore로 만듭니다. RSA는 RSA Data Security, Inc.에서 개발한 공개 키 암호화 기술입니다. RSA는 기술 발명자인 Rivest, Shamir, Adelman의 약자입니다.
keytool -genkey -noprompt -trustcacerts -keyalg RSA -alias ${cert.alias} -dname ${dn.name} -keypass ${key.pass} -keystore ${keystore.file} -storepass ${keystore.pass} |
인증서를 만드는 다른 예는 keytool 유틸리티를 사용하여 인증서 생성에 있습니다.
자체 서명된 인증서를 기본 키 알고리즘을 사용하여 JKS 유형의 keystore로 만듭니다.
keytool -genkey -noprompt -trustcacerts -alias ${cert.alias} -dname ${dn.name} -keypass ${key.pass} -keystore ${keystore.file} -storepass ${keystore.pass} |
인증서에 서명하는 예는 keytool 유틸리티를 사용하여 디지털 인증서 서명에 있습니다.
JKS 유형의 keystore에서 사용할 수 있는 인증서를 표시합니다.
keytool -list -v -keystore ${keystore.file} -storepass ${keystore.pass} |
JKS 유형의 keystore에서 인증서 정보를 표시합니다.
keytool -list -v -alias ${cert.alias} -keystore ${keystore.file} -storepass ${keystore.pass} |
RFC/텍스트 형식 인증서를 JKS 저장소로 가져옵니다. 인증서는 대체로 바이너리 인코딩 대신 인터넷 RFC(Request for Comments) 1421 표준으로 정의한 인쇄 가능한 인코딩 형식으로 저장됩니다. Base 64 인코딩이라고도 하는 이 인증서 형식은 인증서를 다른 응용 프로그램으로 전자 메일이나 몇 가지 다른 메커니즘을 통해 간편하게 내보낼 수 있게 해줍니다.
keytool -import -noprompt -trustcacerts -alias ${cert.alias} -file ${cert.file} -keystore ${keystore.file} -storepass ${keystore.pass} |
JKS 유형의 keystore에서 PKCS7 형식으로 인증서를 내보냅니다. Public Key Cryptography Standards(공개 키 암호화 표준) #7과 Cryptographic Message Syntax Standard(암호화 메시지 구문 표준)로 정의한 응답 형식에는 발행된 인증서 외에 지원 인증서 체인이 포함됩니다.
keytool -export -noprompt -alias ${cert.alias} -file ${cert.file} -keystore ${keystore.file} -storepass ${keystore.pass} |
JKS 유형의 keystore에서 PKCS7 형식으로 인증서를 내보냅니다.
keytool -export -noprompt -rfc -alias ${cert.alias} -file ${cert.file} -keystore ${keystore.file} -storepass ${keystore.pass} |
JKS 유형의 keystore에서 인증서를 삭제합니다.
keytool -delete -noprompt -alias ${cert.alias} -keystore ${keystore.file} -storepass ${keystore.pass} |
keystore에서 인증서를 삭제하는 다른 예는 keytool 유틸리티를 사용하여 인증서를 삭제하는 방법에 있습니다.