COM.claymoresystems.cert
public class CertRequest extends Object
The three main interfaces are
makeSPKACRequest()
makePKCS10Request()
makeSelfSignedCert()
You can access these in a primitive fashion through the
main() function but this gives you a mostly
hardcoded DN with PKCS10 and self-signed (you can choose
the CN).
makeSimpleDN()
offers a way to construct
a fairly simple DN from a simpler construct than the standard
X509Name. At some point we may expose simpler functionality
at the command line.
Method Summary | |
---|---|
protected static byte[] | fitSignature(byte[] tmp, PublicKey pub) |
static KeyPair | generateKey(String type, int size, String password, BufferedWriter keyfile, boolean newParams) Generate a key pair |
static void | main(String[] args) |
static byte[] | makePKCS10Request(KeyPair p, X509Name name) Make a PKCS10 CSR |
static byte[] | makeSelfSignedCert(KeyPair p, X509Name name, int lifetime) Make a Self-signed cert |
static X509Name | makeSimpleDN(Vector rdns) |
static byte[] | makeSPKACRequest(KeyPair p) Make a Netscape Signed Public Key and Cert request |
Parameters: type DSA or RSA size the length password the password to use to encrypted the key keyfile the keyfile to store the key in newParams generate new parameters if using DSA--by default Sun uses fixed precomputed params
Returns: the keypair
Throws: NoSuchAlgorithmException if you choose a key we don't know about NoSuchProviderException internal errors IOException encoding errors
Parameters: p the keypair to make it with name the subject name as an X509Name
Returns: the CSR as a bytestring
Throws: IOException for errors
Parameters: p the keypair to make it with the name to use the lifetime in seconds
Returns: the CSR as a bytestring
Throws: IOException for errors
Parameters: p the keypair to make it with
Returns: the SPKAC as a bytestring
Throws: IOException for errors