org.polyglotted.crypto.asymmetric
Class RsaKeyReader

java.lang.Object
  extended by org.polyglotted.crypto.asymmetric.RsaKeyReader

public abstract class RsaKeyReader
extends Object

RsaKeyReader is a utility used to read DER formatted private and public key files. To create the keys, you would use the "openssl" commands. This is adapted from the blog entry at http://codeartisan.blogspot.co.uk/2009/05/public-key-cryptography-in-java.html

Author:
Shankar Vasudevan

Constructor Summary
RsaKeyReader()
           
 
Method Summary
static PrivateKey readPrivateKey(InputStream is)
          Read the private key from the file
static PublicKey readPublicKey(InputStream is)
          Read the public key from the file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RsaKeyReader

public RsaKeyReader()
Method Detail

readPrivateKey

public static PrivateKey readPrivateKey(InputStream is)
Read the private key from the file

Parameters:
is - the InputStream for the key file
Returns:
the PrivateKey

readPublicKey

public static PublicKey readPublicKey(InputStream is)
Read the public key from the file

Parameters:
is - the InputStream for the key file
Returns:
the PublicKey


Copyright © 2012-2013 Polyglotted Org. All Rights Reserved.