You might want to look into using 'do shell script' with the command ...
keytool(1) keytool(1)
NAME
keytool - key and certificate management tool
SYNOPSIS
keytool [ commands ]
DESCRIPTION
keytool is a key and certificate management utility. It enables users to administer
their own public/private key pairs and associated certificates for use in self-authenti-
cation (where the user authenticates himself/herself to other users/services) or data
integrity and authentication services, using digital signatures. It also allows users to
cache the public keys (in the form of certificates) of their communicating peers.
A certificate is a digitally signed statement from one entity (person, company, and so
forth), saying that the public key (and some other information) of some other entity has
a particular value. (See Certificates.) When data is digitally signed, the signature
can be verified to check the data integrity and authenticity. Integrity means that the
data has not been modified or tampered with, and authenticity means the data indeed
comes from whoever claims to have created and signed it.
keytool stores the keys and certificates in a so-called keystore. The keytool default
keystore implementation implements the keystore as a file. It protects private keys with
a password.
I've never used it, so I have to stop here.