1 KeyStore

Class Ax.ks.KeyStore


Basic keystore wrapper

Constructor Summary

MethodDescription
JSKeyStore()
JSKeyStore(String type)
JSKeyStore(String type, String password)

Method Summary

Modifier and TypeMethodDescription
JSKeyStore load(Object obj, String password)
String toString()

Method Detail

JSKeyStore

 JSKeyStore()

JSKeyStore

 JSKeyStore(String type)
Parameters:
type - 

JSKeyStore

 JSKeyStore(String type, String password)
Parameters:
type - 
password - 

load

                        JSKeyStore load(Object obj, String password)
Parameters:
obj - 
password - 
Returns:

toString

                        String toString()
Returns:

2 KeyStoreManager

Class Ax.ks.KeyStoreManager


Constructor Summary

MethodDescription
JSKeyStoreManager()
JSKeyStoreManager(String type)
JSKeyStoreManager(Object data, String password)
JSKeyStoreManager(KeyStore data, String password)Special constructor to accept a physical KeyStore object (generally produced via fromAlias())

Method Summary

Modifier and TypeMethodDescription
JSKeyStoreManager deleteKeyPair(String alias)Delete key pair
String exportKeyPairAsPEM(String alias, String exportPassword)
byte[] exportKeyPairAsPKCS12(String alias, String exportPassword)
byte[] exportKeyPairCertificate(String alias, Consumer<IExportKeyPairCertificate> configurator)Export KeyPairCertificateChain with integrated configurator
byte[] exportKeyPairPrivateKeyAsOpenSSL(String alias, String exportPassword)
byte[] exportKeyPairPrivateKeyAsOpenSSL(String alias, String exportPassword, boolean pemEncoded, OpenSslPbeType openSSLAlgorith)
byte[] exportKeyPairPrivateKeyAsPKCS8(String alias, String exportPassword)
byte[] exportKeyPairPrivateKeyAsPKCS8(String alias, String exportPassword, boolean pemEncoded, Pkcs8PbeType pkcs8Algorith)
byte[] exportKeyPairPrivateKeyAsPKV(String alias, String exportPassword)
byte[] exportKeyPairPrivateKeyAsPKV(String alias, String exportPassword, boolean strongEncryption)
byte[] exportKeyPairPublicKey(String alias, boolean pemEncoded)
byte[] exportTrustedCertificate(String alias, Consumer<IExportTrustedCertificate> configurator)Export Trusted Certificate
byte[] exportTrustedCertificatePublicKey(String alias, boolean pemEncoded)Export Trusted Certificate Public Key
KeyStore fromAlias(String alias, String password)
KeyStore fromAlias(String alias, String password, String type)Create a new KeyStore for given alias and KeyStore type and password
byte[] generateCSR(String alias, Consumer<CSROptions> configurator)Generate CSR file
JSKeyStoreManager generateKeyPair(String alias, String password, String algorithm, int keyPairSize, Consumer<IGenerateKeyPair> configurator)Generate a new key pair
JSKeyStoreManager generateKeyPair(String alias, String password, String algorithm, int keyPairSize, String curveName, Consumer<IGenerateKeyPair> configurator)Generate a new key pair
Certificate getCertificate(String alias)
Certificate[] getCertificateChain(String alias)Return the certificate chain from a given KeyStore alias
CertificateNode getCertificateTree(String alias)Return the certificate tree of a KeyStore entry
String getEntryType(String alias)Return the entry type of a given KeyStore alias
String getFingerprintDigest(String alias, String algorithm)Get the digest of a fingerprint as a formatted String.
KeyPair getKeyPair(String alias)Return the Key Pair of a given KeyStore alias
KeyStore getKeyStore()Return the underlying KeyStore object
PrivateKey getPrivateKey(String alias, String password)
PrivateKey getPrivateKey(String alias)
PublicKey getPublicKey(String alias)
List getRedoActions()
List getSignatureTypes()Return the signature types
List getUndoActions()
JSKeyStoreManager importCAReply(String alias, String password, byte[] caReply)Import CA replay
void importKeyPairPrivateKeyAsOpenSSL(String alias, String outputPassword, Object src_privateKey, Object src_certificates, String privateKeyPassword)Import OpenSSL key pair file into existing KeyStore
void importKeyPairPrivateKeyAsPkcs12(String alias, String outputPassword, Object src_keyStore, String keyStorePassword)Import Pkcs12 key pair file into existing KeyStore
void importKeyPairPrivateKeyAsPkcs8(String alias, String outputPassword, Object src_privateKey, Object src_certificates, String privateKeyPassword)Import PKCS #8 key pair file into existing KeyStore
void importKeyPairPrivateKeyAsPvk(String alias, String outputPassword, Object src_privateKey, Object src_certificates, String privateKeyPassword)Import PVK key pair file into existing KeyStore
void importTrustedCertificate(Object src_certificate, String alias)Import a Trusted Certificate into an existing KeyStore
void redo()
JSKeyStoreManager renameKeyPair(String alias, String newAlias)Rename key pair
JSKeyStoreManager setKeyPairPassword(String alias, String newPassword)Set a new password for key pair
JSKeyStoreManager setPassword(String password)Set a new keystore pasword
byte[] signCSR(String alias, String password, File csrFile)Sign a CSR(Certificate Signing Request)
JDBCBlob toBlob()
ResultSet toResultSet()
void undo()
JSKeyStoreManager unlockEntry(String alias, String password)Unlock key pair entry
JSKeyStoreManager writeTo(JSFile file)
JSKeyStoreManager writeTo(JSFile file, String password)
JSKeyStoreManager writeTo(File file, String password)
JSKeyStoreManager writeTo(JSBlob blob)
JSKeyStoreManager writeTo(JSBlob blob, String password)

Method Detail

JSKeyStoreManager

 JSKeyStoreManager()

JSKeyStoreManager

 JSKeyStoreManager(String type)
Parameters:
type - 

JSKeyStoreManager

 JSKeyStoreManager(Object data, String password)
Parameters:
data - 
password - 

JSKeyStoreManager

 JSKeyStoreManager(KeyStore data, String password)
Info:
Special constructor to accept a physical KeyStore object (generally produced via fromAlias())
Parameters:
data - 
password - 

deleteKeyPair

                        JSKeyStoreManager deleteKeyPair(String alias)
Info:
Delete key pair
Parameters:
alias - 
Returns:

exportKeyPairAsPEM

                        String exportKeyPairAsPEM(String alias, String exportPassword)
Parameters:
alias - 
exportPassword - 
Returns:

exportKeyPairAsPKCS12

byte[] exportKeyPairAsPKCS12(String alias, String exportPassword)
Parameters:
alias - 
exportPassword - 
Returns:

exportKeyPairCertificate

byte[] exportKeyPairCertificate(String alias, Consumer<IExportKeyPairCertificate> configurator)
Info:
Export KeyPairCertificateChain with integrated configurator
Parameters:
alias - 
configurator - 
Returns:

exportKeyPairPrivateKeyAsOpenSSL

byte[] exportKeyPairPrivateKeyAsOpenSSL(String alias, String exportPassword)
Parameters:
alias - 
exportPassword - 
Returns:

exportKeyPairPrivateKeyAsOpenSSL

byte[] exportKeyPairPrivateKeyAsOpenSSL(String alias, String exportPassword, boolean pemEncoded, OpenSslPbeType openSSLAlgorith)
Parameters:
alias - 
exportPassword - 
pemEncoded - 
openSSLAlgorith - 
Returns:

exportKeyPairPrivateKeyAsPKCS8

byte[] exportKeyPairPrivateKeyAsPKCS8(String alias, String exportPassword)
Parameters:
alias - 
exportPassword - 
Returns:

exportKeyPairPrivateKeyAsPKCS8

byte[] exportKeyPairPrivateKeyAsPKCS8(String alias, String exportPassword, boolean pemEncoded, Pkcs8PbeType pkcs8Algorith)
Parameters:
alias - 
exportPassword - 
pemEncoded - 
pkcs8Algorith - 
Returns:

exportKeyPairPrivateKeyAsPKV

byte[] exportKeyPairPrivateKeyAsPKV(String alias, String exportPassword)
Parameters:
alias - 
exportPassword - 
Returns:

exportKeyPairPrivateKeyAsPKV

byte[] exportKeyPairPrivateKeyAsPKV(String alias, String exportPassword, boolean strongEncryption)
Parameters:
alias - 
exportPassword - 
strongEncryption - 
Returns:

exportKeyPairPublicKey

byte[] exportKeyPairPublicKey(String alias, boolean pemEncoded)
Parameters:
alias - 
pemEncoded - 
Returns:

exportTrustedCertificate

byte[] exportTrustedCertificate(String alias, Consumer<IExportTrustedCertificate> configurator)
Info:
Export Trusted Certificate
Parameters:
alias - 
configurator - 
Returns:

exportTrustedCertificatePublicKey

byte[] exportTrustedCertificatePublicKey(String alias, boolean pemEncoded)
Info:
Export Trusted Certificate Public Key
Parameters:
alias - 
pemEncoded - 
Returns:

fromAlias

                        KeyStore fromAlias(String alias, String password)
Parameters:
alias - 
password - 
Returns:

fromAlias

                        KeyStore fromAlias(String alias, String password, String type)
Info:
Create a new KeyStore for given alias and KeyStore type and password
Parameters:
alias - 
password - 
type - 
Returns:

generateCSR

byte[] generateCSR(String alias, Consumer<CSROptions> configurator)
Info:
Generate CSR file
Parameters:
alias - 
configurator - 
Returns:

generateKeyPair

                        JSKeyStoreManager generateKeyPair(String alias, String password, String algorithm, int keyPairSize, Consumer<IGenerateKeyPair> configurator)
Info:
Generate a new key pair
Parameters:
alias - 
password - 
algorithm - 
keyPairSize - 
configurator - 
Returns:

generateKeyPair

                        JSKeyStoreManager generateKeyPair(String alias, String password, String algorithm, int keyPairSize, String curveName, Consumer<IGenerateKeyPair> configurator)
Info:
Generate a new key pair
Parameters:
alias - 
password - 
algorithm - 
keyPairSize - 
curveName - 
configurator - 
Returns:

getCertificate

                        Certificate getCertificate(String alias)
Parameters:
alias - 
Returns:

getCertificateChain

                        Certificate[] getCertificateChain(String alias)
Info:
Return the certificate chain from a given KeyStore alias
Parameters:
alias - 
Returns:

getCertificateTree

                        CertificateNode getCertificateTree(String alias)
Info:
Return the certificate tree of a KeyStore entry
Parameters:
alias - 
Returns:
the certificate tree ---+ Software View Certificate Authority - CN=Software View Certificate Authority,OU=Training,O=Software View,L=Colombo,ST=Western,C=LK ---+ Jack Daniel - CN=Jack Daniel,OU=Training,O=Software View,L=Colombo,ST=Western,C=LK

getEntryType

                        String getEntryType(String alias)
Info:
Return the entry type of a given KeyStore alias
Parameters:
alias - 
Returns:

getFingerprintDigest

                        String getFingerprintDigest(String alias, String algorithm)
Info:
Get the digest of a fingerprint as a formatted String. Returned in base-16 with ':' separators every two characters padded with a leading 0 if necessary to make for an even number of hex characters.
Parameters:
alias - 
algorithm - 
Returns:
the fingerprint digest

getKeyPair

                        KeyPair getKeyPair(String alias)
Info:
Return the Key Pair of a given KeyStore alias
Parameters:
alias - 
Returns:
the underlying KeyStore object

getKeyStore

                        KeyStore getKeyStore()
Info:
Return the underlying KeyStore object
Returns:
the underlying KeyStore object

getPrivateKey

                        PrivateKey getPrivateKey(String alias, String password)
Parameters:
alias - 
password - 
Returns:

getPrivateKey

                        PrivateKey getPrivateKey(String alias)
Parameters:
alias - 
Returns:

getPublicKey

                        PublicKey getPublicKey(String alias)
Parameters:
alias - 
Returns:

getRedoActions

                        List getRedoActions()
Returns:

getSignatureTypes

                        List getSignatureTypes()
Info:
Return the signature types
Returns:
the signature types

getUndoActions

                        List getUndoActions()
Returns:

importCAReply

                        JSKeyStoreManager importCAReply(String alias, String password, byte[] caReply)
Info:
Import CA replay
Parameters:
alias - 
password - 
caReply - 
Returns:

importKeyPairPrivateKeyAsOpenSSL

void importKeyPairPrivateKeyAsOpenSSL(String alias, String outputPassword, Object src_privateKey, Object src_certificates, String privateKeyPassword)
Info:
Import OpenSSL key pair file into existing KeyStore
Parameters:
alias - 
outputPassword - 
src_privateKey - 
src_certificates - 
privateKeyPassword - 

importKeyPairPrivateKeyAsPkcs12

void importKeyPairPrivateKeyAsPkcs12(String alias, String outputPassword, Object src_keyStore, String keyStorePassword)
Info:
Import Pkcs12 key pair file into existing KeyStore
Parameters:
alias - 
outputPassword - 
src_keyStore - 
keyStorePassword - 

importKeyPairPrivateKeyAsPkcs8

void importKeyPairPrivateKeyAsPkcs8(String alias, String outputPassword, Object src_privateKey, Object src_certificates, String privateKeyPassword)
Info:
Import PKCS #8 key pair file into existing KeyStore
Parameters:
alias - 
outputPassword - 
src_privateKey - 
src_certificates - 
privateKeyPassword - 

importKeyPairPrivateKeyAsPvk

void importKeyPairPrivateKeyAsPvk(String alias, String outputPassword, Object src_privateKey, Object src_certificates, String privateKeyPassword)
Info:
Import PVK key pair file into existing KeyStore
Parameters:
alias - 
outputPassword - 
src_privateKey - 
src_certificates - 
privateKeyPassword - 

importTrustedCertificate

void importTrustedCertificate(Object src_certificate, String alias)
Info:
Import a Trusted Certificate into an existing KeyStore
Parameters:
src_certificate - 
alias - 

redo

void redo()

renameKeyPair

                        JSKeyStoreManager renameKeyPair(String alias, String newAlias)
Info:
Rename key pair
Parameters:
alias - 
newAlias - 
Returns:

setKeyPairPassword

                        JSKeyStoreManager setKeyPairPassword(String alias, String newPassword)
Info:
Set a new password for key pair
Parameters:
alias - 
newPassword - 
Returns:

setPassword

                        JSKeyStoreManager setPassword(String password)
Info:
Set a new keystore pasword
Parameters:
password - 
Returns:

signCSR

byte[] signCSR(String alias, String password, File csrFile)
Info:
Sign a CSR(Certificate Signing Request)
Parameters:
alias - 
password - 
csrFile - 
Returns:

toBlob

                        JDBCBlob toBlob()
Returns:

toResultSet

                        ResultSet toResultSet()
Returns:

undo

void undo()

unlockEntry

                        JSKeyStoreManager unlockEntry(String alias, String password)
Info:
Unlock key pair entry
Parameters:
alias - 
password - 
Returns:

writeTo

                        JSKeyStoreManager writeTo(JSFile file)
Parameters:
file - 
Returns:

writeTo

                        JSKeyStoreManager writeTo(JSFile file, String password)
Parameters:
file - 
password - 
Returns:

writeTo

                        JSKeyStoreManager writeTo(File file, String password)
Parameters:
file - 
password - the password to be used to write the keystore or null to use current password
Returns:

writeTo

                        JSKeyStoreManager writeTo(JSBlob blob)
Parameters:
blob - 
Returns:

writeTo

                        JSKeyStoreManager writeTo(JSBlob blob, String password)
Parameters:
blob - 
password - the password to be used to write the keystore or null to use current password
Returns: