Error while using anaplan-connect-4.1.0 .bat scripts to connect to Anaplan portal



We have recently purchase a CA certificate (.P12 ) from Entrust.

We followed the Interactive CA Certificate from Anaplan and converted our .P12 file to Public certificate and Privatekey.Pem files using OpenSSL 1.1.1.

Uploaded the modified Public certificate into Anaplan portal and it worked fine.

When I tried to implement the Public certificate and Privatekey.Pem files in .bat script (anaplan-connect-4.1.0). I am getting the following error.

If i use the same certificate in anaplan-connect-1.4.1, it works fine.

Error message :

Anaplan API: Could not initialise service credentials (Private key: Could not load your privateKey :C:\New_anaplan\anaplan-connect-4.1.0\CAcert\anaplanpri_key.pem, java.lang.ClassCastException: org.bouncycastle.asn1.pkcs.PrivateKeyInfo cannot be cast to org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo. There might be an issue with your privateKey or passphrase.)


Installed Bouncycaste using Anaplan .bat script. Verified the file is in excepted location.

Also tried to use Keystore, but that is also not working. Keystore Wizard gives me following error.


Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.

Could you please help me with the above error message ?


  • Hi,

    Is your privatekey encrypted. In other words if you open the private key with text editor does it start with "- - - - -BEGIN RSA PRIVATE KEY- - - - -". If this is they you need to get it to non encrypted format. I have used following command for that:

    openssl pkcs8 -topk8 -nocrypt -in private.pem

    This will generate the private key as non encrypted. I have then copypasted this key to a new .pem file.

  • My Private key file is like below.

    -----BEGIN PRIVATE KEY-----

    -----END PRIVATE KEY-----

    But I will try the one that you had suggested

  • Tried the below command, output is the same as my privatekey file.

    openssl pkcs8 -topk8 -nocrypt -in private.pem

    created a new file with this output data and ran the scripts and still getting the same error message.

    I tired it in Anaplan connect v4.0.3, still getting the same error.