Generate a Public and Private Key Pair

  • Generate a keystore with private key

keytool -genkey -v -alias YOUR_ALIAS>'' -keyalg EC -sigalg SHA256withECDSA -deststoretype pkcs12 -keystore <FILE_NAME>.jks -dname "CN=xxx,OU=xxx,O=xxx,L=xxx,ST=xxx,C=CN" -validity 365 -storepass <YOUR_PASSWORD> -keypass <YOUR_PASSWORD>

  • Export the certificate corresponding to the private key

keytool -export -alias <YOUR_ALIAS> -keystore <FILE_NAME>.jks -storepass <YOUR_PASSWORD> -rfc -file <FILE_NAME>.cer

  • Extract the public key from the certificate

openssl x509 -in <FILE_NAME>.cer -pubkey -noout > <FILE_NAME>.pem

Copyright © 2025 Cactus Custody all right reserved,powered by GitbookUpdated: 17-Apr-2025 10:11:15

results matching ""

    No results matching ""

    results matching ""

      No results matching ""