1 KeyStore
Class Ax.ks.KeyStore
Constructor Summary
Method Summary
Constructor Detail
Ax.ks.KeyStore.JSKeyStore
-
Ax.ks.KeyStore.JSKeyStore()
- Info:
-
Creates a new KeyStore instance with the default type pkcs12.
Ax.ks.KeyStore.JSKeyStore
-
Ax.ks.KeyStore.JSKeyStore( object ks )
- Info:
-
Creates a new JS KeyStore instance from an existing keystore - Parameters:
- ks -
Ax.ks.KeyStore.JSKeyStore
-
Ax.ks.KeyStore.JSKeyStore( string type )
- Info:
-
Creates a new KeyStore instance with the specified type (implementation): jceks The proprietary keystore implementation provided by the SunJCE provider. jks The proprietary keystore implementation provided by the SUN provider. dks A domain keystore is a collection of keystores presented as a single logical keystore. It is specified by configuration data whose syntax is described in the DomainLoadStoreParameter class. pkcs11 A keystore backed by a PKCS #11 token. pkcs12 The transfer syntax for personal identity information as defined in PKCS #12. - Parameters:
- type - KeyStore type
Ax.ks.KeyStore.JSKeyStore
-
Ax.ks.KeyStore.JSKeyStore( string type, string password )
- Info:
-
Creates a new KeyStore instance with the specified type (implementation). The specified password that will be totally ignored. KeyStore types: jceks The proprietary keystore implementation provided by the SunJCE provider. jks The proprietary keystore implementation provided by the SUN provider. dks A domain keystore is a collection of keystores presented as a single logical keystore. It is specified by configuration data whose syntax is described in the DomainLoadStoreParameter class. pkcs11 A keystore backed by a PKCS #11 token. pkcs12 The transfer syntax for personal identity information as defined in PKCS #12. - Parameters:
- type - KeyStore type
- password - password for the KeyStore
Method Detail
Ax.ks.KeyStore.load
-
object Ax.ks.KeyStore.load( object obj, string password )
- Info:
-
Loads the key/certificate obj, protected with the specified password. - Parameters:
- obj - key/certificate to load
- password - password for the object
- Returns:
- object
Ax.ks.KeyStore.toString
-
string Ax.ks.KeyStore.toString()
- Info:
-
Returns a string with the format: JSKeystore[type] where type is the one defined in instance creation (pcks12 by default). - Returns:
- string
2 KeyStoreManager
Class Ax.ks.KeyStoreManager
Constructor Summary
Method Summary
Constructor Detail
Ax.ks.KeyStoreManager.JSKeyStoreManager
-
Ax.ks.KeyStoreManager.JSKeyStoreManager()
- Info:
-
Creates a new JSKeyStoreManager instance with the default type JCEKS.
Ax.ks.KeyStoreManager.JSKeyStoreManager
-
Ax.ks.KeyStoreManager.JSKeyStoreManager( string type )
- Info:
-
Creates a new JSKeyStoreManager instance with the specified type. Type must be one of the following: JKS, JCEKS, PKCS12, BKS-V1, BKS, UBER, BCFKS. - Parameters:
- type - KeyStoreManager type
Ax.ks.KeyStoreManager.JSKeyStoreManager
-
Ax.ks.KeyStoreManager.JSKeyStoreManager( object data, string password )
- Info:
-
Creates a new JSKeyStoreManager instance and loads the data protected by the given password. - Parameters:
- data - key pair / certificate to store
- password - password for the keystore
Ax.ks.KeyStoreManager.JSKeyStoreManager
-
Ax.ks.KeyStoreManager.JSKeyStoreManager( object data, object managedPassword )
- Info:
-
Creates a new JSKeyStoreManager instance and loads the data protected by the given managed password instance (either generated by JS code or from DB stored passwords). - Parameters:
- data -
- managedPassword -
Ax.ks.KeyStoreManager.JSKeyStoreManager
-
Ax.ks.KeyStoreManager.JSKeyStoreManager( object data, string password )
- Info:
-
Creates a new JSKeyStoreManager instance and loads the data protected by the given password. Special constructor to accept a physical KeyStore object (generally produced via fromAlias()). - Parameters:
- data - key pair / certificate to store
- password - password for the keystore
Method Detail
Ax.ks.KeyStoreManager.deleteKeyPair
-
object Ax.ks.KeyStoreManager.deleteKeyPair( string alias )
- Info:
-
Deletes the key pair from the keystore. Changes will not take effect until KeyStore is saved. - Parameters:
- alias - alias of the key pair to delete
- Returns:
- object
Ax.ks.KeyStoreManager.exportKeyPairAsPEM
-
string Ax.ks.KeyStoreManager.exportKeyPairAsPEM( string alias, string exportPassword )
- Info:
-
Exports the key pair with PEM format. - Parameters:
- alias - key pair alias
- exportPassword - key pair password
- Returns:
- string
Ax.ks.KeyStoreManager.exportKeyPairAsPKCS12
-
byte[] Ax.ks.KeyStoreManager.exportKeyPairAsPKCS12( string alias, string exportPassword )
- Info:
-
Exports he key pair with PKCS#12 format. - Parameters:
- alias - key pair alias
- exportPassword - key pair password
- Returns:
- byte[]
Ax.ks.KeyStoreManager.exportKeyPairCertificate
-
byte[] Ax.ks.KeyStoreManager.exportKeyPairCertificate( string alias, object configurator )
- Info:
-
Exports KeyPairCertificateChain with integrated configurator. - Parameters:
- alias - alias of the certificate chain in the keystore
- configurator - configuration function
- Returns:
- byte[]
Ax.ks.KeyStoreManager.exportKeyPairPrivateKeyAsOpenSSL
-
byte[] Ax.ks.KeyStoreManager.exportKeyPairPrivateKeyAsOpenSSL( string alias, string exportPassword )
- Info:
-
Exports the private key of a key pair in OpenSSL format. - Parameters:
- alias - alias of the private key
- exportPassword - password for future decoding
- Returns:
- byte[]
Ax.ks.KeyStoreManager.exportKeyPairPrivateKeyAsOpenSSL
-
byte[] Ax.ks.KeyStoreManager.exportKeyPairPrivateKeyAsOpenSSL( string alias, string exportPassword, boolean pemEncoded, object openSSLAlgorith )
- Info:
-
Exports the private key of a key pair in PKCS8 format. - Parameters:
- alias - alias of the private key
- exportPassword - password for future decoding
- pemEncoded - whether the private key will be encoded in PEM format
- openSSLAlgorith - OpenSSL algorithm: DES_CBC, DESEDE_CBC, AES_128BIT_CBC, AES_192BIT_CBC, AES_256BIT_CBC
- Returns:
- byte[]
Ax.ks.KeyStoreManager.exportKeyPairPrivateKeyAsPKCS8
-
byte[] Ax.ks.KeyStoreManager.exportKeyPairPrivateKeyAsPKCS8( string alias, string exportPassword )
- Info:
-
Exports the private key of a key pair in PKCS8 format. - Parameters:
- alias - alias of the private key
- exportPassword - password for future decoding
- Returns:
- byte[]
Ax.ks.KeyStoreManager.exportKeyPairPrivateKeyAsPKCS8
-
byte[] Ax.ks.KeyStoreManager.exportKeyPairPrivateKeyAsPKCS8( string alias, string exportPassword, boolean pemEncoded, object pkcs8Algorith )
- Info:
-
Exports the private key of a key pair in PKCS8 format. - Parameters:
- alias - alias of the private key
- exportPassword - password for future decoding
- pemEncoded - whether the private key will be encoded in PEM format
- pkcs8Algorith - PKCS8 algorithm: SHA1_2KEY_DESEDE, SHA1_3KEY_DESEDE, SHA1_40BIT_RC2, SHA1_128BIT_RC2, SHA1_40BIT_RC4, SHA1_128BIT_RC4.
- Returns:
- byte[]
Ax.ks.KeyStoreManager.exportKeyPairPrivateKeyAsPKV
-
byte[] Ax.ks.KeyStoreManager.exportKeyPairPrivateKeyAsPKV( string alias, string exportPassword )
- Info:
-
Exports the private key of a key pair in PKV format. - Parameters:
- alias - alias of the private key
- exportPassword - password for future decoding
- Returns:
- byte[]
Ax.ks.KeyStoreManager.exportKeyPairPrivateKeyAsPKV
-
byte[] Ax.ks.KeyStoreManager.exportKeyPairPrivateKeyAsPKV( string alias, string exportPassword, boolean strongEncryption )
- Info:
-
Exports the private key of a key pair in PKV format. - Parameters:
- alias - alias of the private key
- exportPassword - password for decoding
- strongEncryption - whether the private key will be strongly encrypted or not
- Returns:
- byte[]
Ax.ks.KeyStoreManager.exportKeyPairPublicKey
-
byte[] Ax.ks.KeyStoreManager.exportKeyPairPublicKey( string alias, boolean pemEncoded )
- Info:
-
Exports the public key as a byte array. - Parameters:
- alias - key pair alias
- pemEncoded - whether the public key will be encoded in PEM format
- Returns:
- byte[]
Ax.ks.KeyStoreManager.exportPrivateKeyAsPEM
-
string Ax.ks.KeyStoreManager.exportPrivateKeyAsPEM( string alias )
- Parameters:
- alias -
- Returns:
- string
Ax.ks.KeyStoreManager.exportPublicKeyAsPEM
-
string Ax.ks.KeyStoreManager.exportPublicKeyAsPEM( string alias )
- Parameters:
- alias -
- Returns:
- string
Ax.ks.KeyStoreManager.exportTrustedCertificate
-
byte[] Ax.ks.KeyStoreManager.exportTrustedCertificate( string alias, object configurator )
- Info:
-
Exports a Trusted Certificate. - Parameters:
- alias - alias of the certificate in the keystore
- configurator - configuration function
- Returns:
- byte[]
Ax.ks.KeyStoreManager.exportTrustedCertificatePublicKey
-
byte[] Ax.ks.KeyStoreManager.exportTrustedCertificatePublicKey( string alias, boolean pemEncoded )
- Info:
-
Exports the Trusted Certificate Public Key. - Parameters:
- alias - alias of the certificate
- pemEncoded - whether the returned public key will be encoded in PEM format
- Returns:
- byte[]
Ax.ks.KeyStoreManager.fromAlias
-
object Ax.ks.KeyStoreManager.fromAlias( string alias, string password )
- Info:
-
Creates a new KeyStore from the entry defined with the given alias and password. - Parameters:
- alias - KeyStore alias
- password - KeyStore password
- Returns:
- object
Ax.ks.KeyStoreManager.fromAlias
-
object Ax.ks.KeyStoreManager.fromAlias( string alias, string password, string type )
- Info:
-
Create a new KeyStore for given alias and KeyStore type and password. - Parameters:
- alias - KeyStore alias
- password - KeyStore type
- type - KeyStore password
- Returns:
- object
Ax.ks.KeyStoreManager.generateCSR
-
byte[] Ax.ks.KeyStoreManager.generateCSR( string alias, object configurator )
- Info:
-
Generates a CSR file. - Parameters:
- alias - key pair alias
- configurator - configuration function
- Returns:
- byte[]
Ax.ks.KeyStoreManager.generateKeyPair
-
object Ax.ks.KeyStoreManager.generateKeyPair( string alias, string password, string algorithm, smallint keyPairSize, object configurator )
- Info:
-
Generates a new key pair. Use this method if you want to use HTTP (HTTP over TLS) to secure your Java application. This will create a new key pair in a new or existing Java Keystore, which can be used to create a CSR, and obtain an SSL certificate from a Certificate Authority. - Parameters:
- alias - alias for the new key pair
- password - password for the new key pair
- algorithm - algorithm for the new key pair generation (RSA, DSA, EC)
- keyPairSize - size for the key pair
- configurator - function to configure the key pair generation options
- Returns:
- object
Ax.ks.KeyStoreManager.generateKeyPair
-
object Ax.ks.KeyStoreManager.generateKeyPair( string alias, string password, string algorithm, smallint keyPairSize, string curveName, object configurator )
- Info:
-
Generates a new key pair. - Parameters:
- alias - alias for the new key pair
- password - password for the new key pair
- algorithm - algorithm for the new key pair generation (RSA, DSA, EC)
- keyPairSize - size for the key pair
- curveName - curve name required for EC algorithm
- configurator - function to configure the key pair generation options
- Returns:
- object
Ax.ks.KeyStoreManager.getCertificate
-
object Ax.ks.KeyStoreManager.getCertificate( string alias )
- Info:
-
Returns the certificate form a given alias. - Parameters:
- alias - the alias of the certificate
- Returns:
- object
Ax.ks.KeyStoreManager.getCertificateChain
-
object Ax.ks.KeyStoreManager.getCertificateChain( string alias )
- Info:
-
Returns the certificate chain from a given alias. - Parameters:
- alias - the alias of the certificate chain
- Returns:
- object
Ax.ks.KeyStoreManager.getCertificateTree
-
object Ax.ks.KeyStoreManager.getCertificateTree( string alias )
- Info:
-
Returns the certificate tree of a KeyStore entry. ---+ 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 - Parameters:
- alias -
- Returns:
- object
Ax.ks.KeyStoreManager.getEntryType
-
string Ax.ks.KeyStoreManager.getEntryType( string alias )
- Info:
-
Return the entry type of a given KeyStore alias - Parameters:
- alias - the alias of the entry
- Returns:
- string
Ax.ks.KeyStoreManager.getFingerprintDigest
-
string Ax.ks.KeyStoreManager.getFingerprintDigest( string alias, string algorithm )
- Info:
-
Gets 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 - alias of the certificate
- algorithm - digest algorithm: MD2, MD4, MD5, RIPEMD128, RIPEMD160, RIPEMD256, SHA1, SHA224, SHA256, SHA384, SHA512.
- Returns:
- string
Ax.ks.KeyStoreManager.getKeyPair
-
object Ax.ks.KeyStoreManager.getKeyPair( string alias )
- Info:
-
Returns the Key Pair of a given alias. - Parameters:
- alias - alias of the key pair
- Returns:
- object
Ax.ks.KeyStoreManager.getKeyStore
-
object Ax.ks.KeyStoreManager.getKeyStore()
- Info:
-
Returns the underlying KeyStore object. - Returns:
- object
Ax.ks.KeyStoreManager.getPrivateKey
-
object Ax.ks.KeyStoreManager.getPrivateKey( string alias, string password )
- Info:
-
Returns the private key from a given alias. - Parameters:
- alias - alias of the key
- password - password of the keystore entry
- Returns:
- object
Ax.ks.KeyStoreManager.getPrivateKey
-
object Ax.ks.KeyStoreManager.getPrivateKey( string alias )
- Info:
-
Returns the private key from a given alias. Entry must be unlocked. - Parameters:
- alias - alias of the key
- Returns:
- object
Ax.ks.KeyStoreManager.getPublicKey
-
object Ax.ks.KeyStoreManager.getPublicKey( string alias )
- Info:
-
Returns the public key from a given alias. - Parameters:
- alias - alias of the certificate
- Returns:
- object
Ax.ks.KeyStoreManager.getRedoActions
-
array Ax.ks.KeyStoreManager.getRedoActions()
- Info:
-
Returns a list of all the actions undone, that is, the actions of the keystore states posterior the current state. - Returns:
- array
Ax.ks.KeyStoreManager.getSignatureTypes
-
array Ax.ks.KeyStoreManager.getSignatureTypes()
- Info:
-
Returns the DSA, RSA and ECDSA signature types. - Returns:
- array
Ax.ks.KeyStoreManager.getUndoActions
-
array Ax.ks.KeyStoreManager.getUndoActions()
- Info:
-
Returns a list of all the previous actions done, that is, the actions of the keystore states previous to the current state. - Returns:
- array
Ax.ks.KeyStoreManager.importCAReply
-
object Ax.ks.KeyStoreManager.importCAReply( string alias, string password, byte[] caReply )
- Info:
-
Imports CA reply. Importing the CA Reply will replace your certificate with a certificate chain. - Parameters:
- alias - keystore entry alias
- password - keystore entry password
- caReply - CA Reply certificates
- Returns:
- object
Ax.ks.KeyStoreManager.importKeyPairPrivateKeyAsOpenSSL
-
null Ax.ks.KeyStoreManager.importKeyPairPrivateKeyAsOpenSSL( string alias, string outputPassword, object src_privateKey, object src_certificates, string privateKeyPassword )
- Info:
-
Imports an OpenSSL key pair file into an existing KeyStore. - Parameters:
- alias - alias for the key pair
- outputPassword - password for the keystore
- src_privateKey - private key
- src_certificates - certificates
- privateKeyPassword - password for the private key.
- Returns:
- null
Ax.ks.KeyStoreManager.importKeyPairPrivateKeyAsPkcs12
-
null Ax.ks.KeyStoreManager.importKeyPairPrivateKeyAsPkcs12( string alias, string outputPassword, object src_keyStore, string keyStorePassword )
- Info:
-
Imports a PKCS#12 key pair file into an existing KeyStore. - Parameters:
- alias - alias for the key pair
- outputPassword -
- src_keyStore - keystore to import the key pair
- keyStorePassword - password for the key pair in the keystore
- Returns:
- null
Ax.ks.KeyStoreManager.importKeyPairPrivateKeyAsPkcs8
-
null Ax.ks.KeyStoreManager.importKeyPairPrivateKeyAsPkcs8( string alias, string outputPassword, object src_privateKey, object src_certificates, string privateKeyPassword )
- Info:
-
Imports a PKCS #8 key pair file into an existing KeyStore. - Parameters:
- alias - alias for the private key
- outputPassword - keystore password
- src_privateKey - private key
- src_certificates - certificates
- privateKeyPassword - password for the private key
- Returns:
- null
Ax.ks.KeyStoreManager.importKeyPairPrivateKeyAsPvk
-
null Ax.ks.KeyStoreManager.importKeyPairPrivateKeyAsPvk( string alias, string outputPassword, object src_privateKey, object src_certificates, string privateKeyPassword )
- Info:
-
Imports a PVK key pair file into an existing KeyStore. - Parameters:
- alias - alias for the private key
- outputPassword - password for the keystore
- src_privateKey - private key
- src_certificates - certificates
- privateKeyPassword - password for the private key
- Returns:
- null
Ax.ks.KeyStoreManager.importTrustedCertificate
-
null Ax.ks.KeyStoreManager.importTrustedCertificate( object src_certificate, string alias )
- Info:
-
Imports a Trusted Certificate into an existing KeyStore. - Parameters:
- src_certificate - the trusted certificate
- alias - alias for the certificate in the keystore
- Returns:
- null
Ax.ks.KeyStoreManager.redo
-
null Ax.ks.KeyStoreManager.redo()
- Info:
-
Redoes the last action undone, that is, sets the next keystore state as the current state. - Returns:
- null
Ax.ks.KeyStoreManager.renameKeyPair
-
object Ax.ks.KeyStoreManager.renameKeyPair( string alias, string newAlias )
- Info:
-
Renames the keypair, changing its alias. Changes will not take effect until KeyStore is saved. - Parameters:
- alias - new keypair alias
- newAlias -
- Returns:
- object
Ax.ks.KeyStoreManager.setKeyPairPassword
-
object Ax.ks.KeyStoreManager.setKeyPairPassword( string alias, string newPassword )
- Info:
-
Sets a new password for the key pair. - Parameters:
- alias - keystore alias
- newPassword - new password for the key pair
- Returns:
- object
Ax.ks.KeyStoreManager.setPassword
-
object Ax.ks.KeyStoreManager.setPassword( string password )
- Info:
-
Sets a new keystore password, or changes the actual one. - Parameters:
- password - new password for the keystore
- Returns:
- object
Ax.ks.KeyStoreManager.signCSR
-
byte[] Ax.ks.KeyStoreManager.signCSR( string alias, string password, file csrFile )
- Info:
-
Signs a CSR(Certificate Signing Request). - Parameters:
- alias - key pair alias
- password - key pair password
- csrFile - CSR file to sign
- Returns:
- byte[]
Ax.ks.KeyStoreManager.toBlob
-
object Ax.ks.KeyStoreManager.toBlob()
- Info:
-
Converts the keystore to a BLOB object. - Returns:
- object
Ax.ks.KeyStoreManager.toResultSet
-
resultset Ax.ks.KeyStoreManager.toResultSet()
- Info:
-
Converts the keystore to a ResultSet. - Returns:
- resultset
Ax.ks.KeyStoreManager.undo
-
null Ax.ks.KeyStoreManager.undo()
- Info:
-
Undoes the last action, that is, sets the previous keystore state as the current state. - Returns:
- null
Ax.ks.KeyStoreManager.unlockEntry
-
object Ax.ks.KeyStoreManager.unlockEntry( string alias, string password )
- Info:
-
Unlocks the key pair entry. Entries may be secured with password. Its content (KeyPair or certificate) will not be accessible until unlocked. - Parameters:
- alias - keystore alias
- password - password for unlock
- Returns:
- object
Ax.ks.KeyStoreManager.writeTo
-
object Ax.ks.KeyStoreManager.writeTo( file file )
- Info:
-
Writes the keystore on the specified file. - Parameters:
- file - file to store the keystore
- Returns:
- object
Ax.ks.KeyStoreManager.writeTo
-
object Ax.ks.KeyStoreManager.writeTo( file file, string password )
- Info:
-
Writes the keystore on the specified file with the given password. - Parameters:
- file - file to store the keystore
- password - the password to be used to write the keystore or null to use current password
- Returns:
- object
Ax.ks.KeyStoreManager.writeTo
-
object Ax.ks.KeyStoreManager.writeTo( file file, string password )
- Info:
-
Writes the keystore on the specified file with the given password. - Parameters:
- file - file to store the keystore
- password - the password to be used to write the keystore or null to use current password
- Returns:
- object
Ax.ks.KeyStoreManager.writeTo
-
object Ax.ks.KeyStoreManager.writeTo( object blob )
- Info:
-
Writes the keystore to a BLOB. - Parameters:
- blob - blob where the keystore will be written
- Returns:
- object
Ax.ks.KeyStoreManager.writeTo
-
object Ax.ks.KeyStoreManager.writeTo( object blob, string password )
- Info:
-
Writes the keystore to a BLOB. - Parameters:
- blob - blob where the keystore will be written
- password - the password to be used to write the keystore or null to use current password
- Returns:
- object