Looks like a bad idea to me because it is error prone. What if I want two keys? Caching should be done by the caller of getOpenSSLPkey().