COM.claymoresystems.cert
Class CertRequest
java.lang.Object
COM.claymoresystems.cert.CertRequest
public class CertRequest
extends java.lang.Object
Generate various kinds of certificate signing requests.
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.
fitSignature
protected static byte[] fitSignature(byte[] tmp,
PublicKey pub)
generateKey
public static KeyPair generateKey(String type,
int size,
String password,
BufferedWriter keyfile,
boolean newParams)
throws NoSuchAlgorithmException,
NoSuchProviderException,
IOException
Generate a key pair
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 params
main
public static void main(String[] args)
throws IOException,
Exception
makePKCS10Request
public static byte[] makePKCS10Request(KeyPair p,
X509Name name)
throws IOException
Make a PKCS10 CSR
p
- the keypair to make it withname
- the subject name as an X509Name
makeSPKACRequest
public static byte[] makeSPKACRequest(KeyPair p)
throws IOException
Make a Netscape Signed Public Key and Cert request
p
- the keypair to make it with
- the SPKAC as a bytestring
makeSelfSignedCert
public static byte[] makeSelfSignedCert(KeyPair p,
X509Name name,
int lifetime)
throws IOException
Make a Self-signed cert
p
- the keypair to make it with
makeSimpleDN
public static X509Name makeSimpleDN(Vector rdns)
Copyright (c) 1999-2001 Claymore Systems, Inc., All Rights Reserved.