3.8. GnuTLS를 사용하여 TLS 클라이언트 인증서에 대한 개인 키 및 CSR 생성

인증서를 받으려면 먼저 클라이언트의 개인 키와 CSR(인증서 서명 요청)을 생성해야 합니다.

절차

  1. 클라이언트 시스템에서 개인 키를 생성합니다. 예를 들면 다음과 같습니다.

    $ certtool --generate-privkey --sec-param High --outfile <example-client.key>
  2. 선택 사항: 선택한 텍스트 편집기를 사용하여 CSR 생성을 간소화하는 구성 파일을 준비합니다. 예를 들면 다음과 같습니다.

    $ vim <example_client.cnf>
    signing_key
    encryption_key
    
    tls_www_client
    
    cn = "client.example.com"
    email = "client@example.com"
  3. 이전에 생성한 개인 키를 사용하여 CSR을 생성합니다.

    $ certtool --generate-request --template <example-client.cfg> --load-privkey <example-client.key> --outfile <example-client.crq>

    --template 옵션을 생략하면 certtool 유틸리티에서 추가 정보를 입력하라는 메시지를 표시합니다. 예를 들면 다음과 같습니다.

    Generating a PKCS #10 certificate request...
    Country name (2 chars): <US>
    State or province name: <Washington>
    Locality name: <Seattle>
    Organization name: <Example Organization>
    Organizational unit name:
    Common name: <server.example.com>

다음 단계

검증

  1. 사용자가 읽을 수 있는 인증서 부분이 요구 사항과 일치하는지 확인합니다. 예를 들면 다음과 같습니다.

    $ certtool --certificate-info --infile <example-client.crt>
    Certificate:
    …
                X509v3 Extended Key Usage:
                    TLS Web Client Authentication
                X509v3 Subject Alternative Name:
                    email:client@example.com
    …

추가 리소스

  • certtool(1) 도움말 페이지