1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

2026年04月の定例にて追加された、未署名ないし信頼できない署名がされているRDPファイルへの警告ダイアログボックス。
image.png
RDPファイルをクリックして接続しようとする際に、毎回リモートコンピューターに対して許可するリソースを選択するという状態から正しく解放されるには、RDPファイルに正当な署名をする必要があります。
今回は、PQC(耐量子暗号アルゴリズム)を使ってRDP用の証明書を作成し、署名を行ってみることにします。

証明書の作成

CA証明書とコード署名証明書をML-DSA-87で作成することにします。
Windowsの1コンポーネントにて使用する証明書で、主に必要とするのがエンタープライズ環境であることを考えるとADCSを用いるのが常と思われますが、PQCには非対応でしたのでLinux上のOpenSSLで作成しました。
ADCSを使用して従来のアルゴリズムを使った証明書を作成・展開する場合には、以下の記事が参考になると思います。

環境: AlmaLinux 10.2 + OpenSSL 3.5.5
まずはCA証明書の用途を厳密にします。

/etc/ssl/openssl.cnf
[ v3_ca ]


# Extensions for a typical CA


# PKIX recommendation.

subjectKeyIdentifier=hash

authorityKeyIdentifier=keyid:always,issuer

basicConstraints = critical,CA:true

# Key usage: this is typical for a CA certificate. However since it will
# prevent it being used as an test self-signed certificate it is best
# left out by default.
- #keyUsage = cRLSign, keyCertSign
+ keyUsage = cRLSign, keyCertSign

CA証明書を作成します。

$ openssl req -new -newkey ml-dsa-87 -keyout ca_priv.pem -out ca_cert.crt -x509 -extensions v3_ca

rdpsignで署名する際に必要な用途を追加するために、その内容を記述したファイルを作成します。

/tmp/keyUsage
keyUsage = critical,digitalSignature
extendedKeyUsage = critical,codeSigning

コード署名証明書を作成します。

$ openssl genpkey -algorithm ml-dsa-87 -out privkey.pem 
$ openssl req -new -key privkey.pem -out request.csr
$ openssl x509 -req -in request.csr -CA ca_cert.crt -CAkey ca_priv.pem -out cert.crt -extfile /tmp/keyUsage

RDPファイルへの署名

サーバー証明書の形式を変換します。

$ openssl pkcs12 -export -inkey privkey.pem -in cert.crt -out cert.pfx

署名を行うマシンの個人ストアにインポートします。この時、ルートCA証明書のインポートは必須ではありません。
image.png
image.png
RDPファイルを用意します。
image.png
RDPファイルに対して署名を行います。

rdpsign /sha256 <sha256 fingerprint> <rdpfile path>

image.png

クライアント端末から接続する

RDPファイルを使用するクライアント端末にて、ルートCA証明書を信頼されたルート証明機関ストアにインポートします。
image.png
この状態で、署名したRDPファイルを用いて接続を試みると、公開元が正しく指定されており、「この発行元からのリモート接続に関する選択を記憶する」という選択肢が出現することがわかります。
image.png
「この発行元からのリモート接続に関する選択を記憶する」「クリップボード」にチェックを入れて接続→切断後再度RDPファイルを開くと、期待通り「クリップボード」が記憶されています。
image.png

おまけ

比較用にRSAの証明書を作成した際のコマンド。

# openssl req -new -keyout ca_priv_rsa.pem -out ca_cert_rsa.crt -x509 -extensions v3_ca
# openssl genpkey -algorithm RSA -out privkey_rsa.pem 
# openssl req -new -key privkey_rsa.pem -out request_rsa.csr 
# openssl x509 -req -in request_rsa.csr -CA ca_cert_rsa.crt -CAkey ca_priv_rsa.pem -out cert_rsa.crt -extfile /tmp/keyUsage
# openssl pkcs12 -export -inkey privkey_rsa.pem -in cert_rsa.crt -out cert_rsa.pfx
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?