getKeyStore() returns a java.security.KeyStore object, which represents a X.509 certificate keystore. If database is not specified, keystore is loaded from ${user.home}/.keystore.
A keystore database should be prepared with keytool before using getKeyStore().
e.g.
ks = getKeyStore("key_pass")
These functions retrieve public key and private key of alias from the keystore.
e.g.
my_key = getPrivateKey(ks, "my_name", "my_pass") my_pub = getPublicKey(ks, "my_name")
|
signObject() returns a java.security.SignedObject object which is created by signing object with the privateKey.
verifyObject() verifies that the signedObject object is signed by the owner of the publicKey.
e.g.
signed = signObject("something", my_key) verifyObject(signed, my_pub)