MacOS ローカルユーザーでのログイン

Compatible Nitrokeys

3A/C/Mini

Passkey

HSM 2

Pro 2

FIDO2

Storage 2

Start

U2F

active

inactive

inactive

inactive

inactive

inactive

inactive

inactive

This document explains how to use the PIV smart card of a Nitrokey 3 for local user logon on MacOS. It is available as of firmware version 1.8 and higher.

前提条件

The following setup was used at the time of writing this guide:

  • MacOS 15.6(セコイア)

  • nitropy 0.10.0

  • Nitrokey 3 with PIV smart card, firmware version 1.8.1

Configure smartcard logon for local use

ニトロキーの PIV アプレットは工場出荷時にリセットされているものと仮定する。しかし、鍵や証明書の上書きも機能するはずである。

PIN、PUK、管理キーが最初に変更されていない場合は、nitropy nk3 piv コマンドを使用する方が簡単です。デフォルト値が適用されるからです。なぜなら、デフォルト値が適用されるからです。すでに変更している場合は、必要な箇所を指定してください。

  1. Generate a key and a certificate in PIV slot 9a:

    
    

    ニトロピ nk3 piv --experimental generate-key --key 9a --algo nistp256 --subject-name "CN=Foo Bar" --subject-alt-name-upn "foo@bar.com"

  2. Generate a key and a certificate in PIV slot 9d:

    
    

    ニトロピ nk3 piv --experimental generate-key --key 9d --algo nistp256 --subject-name "CN=Foo Bar" --subject-alt-name-upn "foo@bar.com"

  3. ニトロキーのスロット9aと9dに証明書があることを確認する:

    
    

    ニトロピ nk3 piv --実験リスト-証明書

  4. ニトロキーがシステムに認識され、IDが見つかることを確認する:

    
    

    sc_auth identities

This should print something like this:

SmartCard: com.apple.pivtoken:<nitrokey serial number>
Unpaired identities:
someId       <username> - Zertifikat zur PIV-Authentifizierung (<CN>)
  1. ニトロキーを抜いて、もう一度差し込んでください。オペレーティングシステムはニトロキーをPIVスマートカードとして認識し、現在ログインしているユーザーとのペアリングを提案するはずです。

  2. また、PIV証明書をMacOSキーチェーンにインポートするためのパスワードを入力する必要がある場合もあります。

  3. PIV ID がローカルの MacOS ユーザと正常にペアリングされていることを確認する:

    
    

    sc_auth list

This should print something like this:

Hash: someId
  1. 完了です。これで、PIV PINを使用してニトロキーでMacにログインできるようになります。