Fork me on GitHub

n. Slang a rough lawless young Kuali developer.
[perhaps variant of Houlihan, Irish surname]
kualiganism n

Blog of an rSmart Java Developer. Full of code examples, solutions, best practices, et al.

Thursday, July 26, 2012

How I Setup My KFS Instance Built from Archetype

This is related to KFS Maven Overlays Made Easy. I didn't give details on how I configured my environment because I felt that's really a post in itself. I'm going to show/describe what configuration files I use and how I went about encrypting my passwords.

Encrypting Passwords

Ok. I'm going to break this down into the following:
  • Creating a PEM public key.
  • Adding the private/public keypair to $HOME/kuali/main/dev/rice.keystore
  • Encrypting the password with the public key

1 Create a PEM public key

I don't need to generate a private/public keypair because I'm using my SSH keys for this. Of course, you could generate your own public/private keypairs with openssl. That's fine, but I'm assuming you're like me and you already have an SSH keypair. Now you just need to create a PEM public key because your SSH RSA public key just isn't going to cut it.

The above will create you a nice little id_rsa.pem file. That's your PEM public key.

2 Import your RSA Private/Public Keys

For the files necessary refer to my post Decryption/ReEncryption With the DemonstrationGradeEncryptionServiceImpl. Don't let the name fool you. There's a in there. Even if you don't use it to replace the DemonstrationGradeEncryptionServiceImpl, you can use it to import your Private/Public keys into your rice.keystore.

You can show your keys like this:

3 Now we want to encrypt our password

The Whole Process went like this for me

My Config

This is what my config ended up looking like. Since I'm working on tem, I have a $HOME/kuali/main/dev/kfs-tem-config.xml


Hope this helps you to setup your config that you can now store in your institution's VCS.


  1. Hi Leo,
    Battling to complete Step 2. Do I need to checkout code from some special branch? Where can I find "RsaEncryptionServiceImpl" you are calling? I copied and pasted above class from one of your previous posts but it also failed with some obscure exception: "DerInputStream.getLength(): lengthTag=127, too big"

    1. @Dylan you want to use the service found here

      After step 1, you should have a public key that looks like:
      -----BEGIN PUBLIC KEY-----
      -----END PUBLIC KEY-----

      Also, make sure when you run step 2 that the id_rsa and id_rsa.pem are in the current working directory. The application requires private and public keys to be inserted into the keystore, so it will look and require both.

  2. Just a note, and I don't know if this is env specific but my private key starts with "-----BEGIN RSA PRIVATE KEY-----" and not "-----BEGIN PRIVATE KEY-----" That causes the program to skip removal of markers (line 185) and fails the process with some arb exception.