public class CertRequest
extends java.lang.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.
| Constructor and Description |
|---|
CertRequest() |
| Modifier and Type | Method and Description |
|---|---|
protected static byte[] |
fitSignature(byte[] tmp,
java.security.PublicKey pub) |
static java.security.KeyPair |
generateKey(java.lang.String type,
int size,
java.lang.String password,
java.io.BufferedWriter keyfile,
boolean newParams)
Generate a key pair
|
static void |
main(java.lang.String[] args) |
static byte[] |
makePKCS10Request(java.security.KeyPair p,
X509Name name)
Make a PKCS10 CSR
|
static byte[] |
makeSelfSignedCert(java.security.KeyPair p,
X509Name name,
int lifetime)
Make a Self-signed cert
|
static X509Name |
makeSimpleDN(java.util.Vector rdns) |
static byte[] |
makeSPKACRequest(java.security.KeyPair p)
Make a Netscape Signed Public Key and Cert request
|
public static java.security.KeyPair generateKey(java.lang.String type,
int size,
java.lang.String password,
java.io.BufferedWriter keyfile,
boolean newParams)
throws java.security.NoSuchAlgorithmException,
java.security.NoSuchProviderException,
java.io.IOException
type - DSA or RSAsize - the lengthpassword - the password to use to encrypted the keykeyfile - the keyfile to store the key innewParams - generate new parameters if using DSA--by default Sun uses fixed precomputed paramsjava.security.NoSuchAlgorithmException - if you choose a key we don't know aboutjava.security.NoSuchProviderException - internal errorsjava.io.IOException - encoding errorspublic static byte[] makeSPKACRequest(java.security.KeyPair p)
throws java.io.IOException
p - the keypair to make it withjava.io.IOException - for errorspublic static byte[] makePKCS10Request(java.security.KeyPair p,
X509Name name)
throws java.io.IOException
p - the keypair to make it withname - the subject name as an X509Namejava.io.IOException - for errorspublic static byte[] makeSelfSignedCert(java.security.KeyPair p,
X509Name name,
int lifetime)
throws java.io.IOException
p - the keypair to make it withthe - name to usethe - lifetime in secondsjava.io.IOException - for errorspublic static X509Name makeSimpleDN(java.util.Vector rdns)
protected static byte[] fitSignature(byte[] tmp,
java.security.PublicKey pub)
public static void main(java.lang.String[] args)
throws java.io.IOException,
java.lang.Exception
java.io.IOExceptionjava.lang.ExceptionCopyright (c) 1999-2001 Claymore Systems, Inc., All Rights Reserved.