KeystoreList()

edit

Lists all aliases in a Java keystore.

Requires Extension: Crypto Extension

KeystoreList( keystore=string, keystorePassword=string, keystoreType=string );

Returns: Array

Argument Description
keystore
string, required
edit

Path to keystore file

keystorePassword
string, required
edit

Password for the keystore

keystoreType
string, optional
edit

Keystore type (JKS, PKCS12). Auto-detected if omitted.

Examples

edit
// List all key aliases in a PKCS#12 keystore
// Auto-detects the keystore type from the .p12 file extension
aliases = KeystoreList( "/path/to/keystore.p12", "keystorePassword" );
// e.g. [ "mykey", "secondkey" ]
// Use this to check what's in a keystore before extracting keys
for ( alias in aliases ) {
	result = GetKeyPairFromKeystore(
		"/path/to/keystore.p12",
		"keystorePassword",
		"keystorePassword",
		alias
	);
	// process each key pair...
}

See also