6.3.2. 公開鍵管理での更新
Eclipse Vert.x 3.x での公開秘密鍵管理の設定オブジェクトは以下を前提とします。
- 鍵はキーペアとして設定します。
- キーデータは、標準の区切り文字なしで PKCS8 でエンコードされた文字列です。
以下の例は、Eclipse Vert.x 3.x でキーペアを設定する方法を示しています。
new PubSecKeyOptions()
.setPublicKey(
// remove the PEM boundaries
pubPemString
.replaceAll("-----BEGIN PUBLIC KEY----")
.replaceAll("-----END PUBLIC KEY----"))
.setSecretKey(
// remove the PEM boundaries
secPemString
.replaceAll("-----BEGIN PUBLIC KEY----")
.replaceAll("-----END PUBLIC KEY----"));
Eclipse Vert.x 4 では、公開鍵と秘密鍵の両方を指定する必要があります。
以下の例は、Eclipse Vert.x 4 でキーペアを設定する方法を示しています。
PubSecKeyOptions pubKey =
new PubSecKeyOptions()
// the buffer is the exact contents of the PEM file and had boundaries included in it
.setBuffer(pubPemString);
PubSecKeyOptions secKey =
new PubSecKeyOptions()
// the buffer is the exact contents of the PEM file and had boundaries included in it
.setBuffer(secPemString);
PubSecKeyOptions を使用して X509 証明書に対応できるようになりました。
PubSecKeyOptions x509Certificate =
new PubSecKeyOptions()
// the buffer is the exact contents of the PEM file and had boundaries included in it
.setBuffer(x509PemString);