org.glite.security.util.proxy
Class RFC3820ProxyCertificateGenerator

java.lang.Object
  extended by org.bouncycastle.x509.X509V3CertificateGenerator
      extended by org.glite.security.util.proxy.RFC3820ProxyCertificateGenerator

public class RFC3820ProxyCertificateGenerator
extends org.bouncycastle.x509.X509V3CertificateGenerator

A generator for RFC 3820 type certificates.

Author:
joni.hahkala@cern.ch

Constructor Summary
RFC3820ProxyCertificateGenerator()
           
 
Method Summary
 java.security.cert.X509Certificate generate(java.security.PrivateKey privateKey)
           
 void setBaseName(org.bouncycastle.asn1.x509.X509Name basename)
          Sets the base name for the subject DN generation.
 void setPathLenLimit(int pathLenLimit)
          Set the path length limit, the number of length of proxy cert chain this proxy is allowed so sign.
 void setPolicyOID(java.lang.String policyOID)
          Sets the policy oid.
 void setProxyCertInfo(java.lang.String policyOID, org.bouncycastle.asn1.DEROctetString policy, int pathLenLimit)
          Sets the proxy certificate info extension.
 void setSerialNumber(java.math.BigInteger sn)
           
 void setSubjectDN(javax.security.auth.x500.X500Principal dnPrincipal)
           
 void setSubjectDN(org.bouncycastle.asn1.x509.X509Name dn)
           
 
Methods inherited from class org.bouncycastle.x509.X509V3CertificateGenerator
addExtension, addExtension, addExtension, addExtension, copyAndAddExtension, copyAndAddExtension, generate, generate, generate, generateX509Certificate, generateX509Certificate, generateX509Certificate, generateX509Certificate, getSignatureAlgNames, reset, setIssuerDN, setIssuerDN, setIssuerUniqueID, setNotAfter, setNotBefore, setPublicKey, setSignatureAlgorithm, setSubjectUniqueID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RFC3820ProxyCertificateGenerator

public RFC3820ProxyCertificateGenerator()
Method Detail

setSerialNumber

public void setSerialNumber(java.math.BigInteger sn)
Overrides:
setSerialNumber in class org.bouncycastle.x509.X509V3CertificateGenerator

setProxyCertInfo

public void setProxyCertInfo(java.lang.String policyOID,
                             org.bouncycastle.asn1.DEROctetString policy,
                             int pathLenLimit)
Sets the proxy certificate info extension.

Parameters:
policyOID - optional proxy policy oid, if not given, the "delegate all policy" oid is used.
policy - optional proxy policy. If no policy is given the oid is assumed to suffice.
pathLenLimit - optional number of subproxies the proxy can have. If null, no restrictions are set.

setPathLenLimit

public void setPathLenLimit(int pathLenLimit)
Set the path length limit, the number of length of proxy cert chain this proxy is allowed so sign.

Parameters:
pathLenLimit - the number of proxies that can follow this in the cert chain.

setPolicyOID

public void setPolicyOID(java.lang.String policyOID)
Sets the policy oid. Useful in cases a policy oid is used without actual policy, like when using: ProxyPolicy.INHERITALL_POLICY_OID, ProxyPolicy.INDEPENDENT_POLICY_OID or ProxyPolicy.LIMITED_PROXY_OID.

Parameters:
policyOID - The oid of the policy to be used.

setSubjectDN

public void setSubjectDN(javax.security.auth.x500.X500Principal dnPrincipal)
Overrides:
setSubjectDN in class org.bouncycastle.x509.X509V3CertificateGenerator

setSubjectDN

public void setSubjectDN(org.bouncycastle.asn1.x509.X509Name dn)
Overrides:
setSubjectDN in class org.bouncycastle.x509.X509V3CertificateGenerator

setBaseName

public void setBaseName(org.bouncycastle.asn1.x509.X509Name basename)
Sets the base name for the subject DN generation. Must be the DN of the parent.

Parameters:
basename -

generate

public java.security.cert.X509Certificate generate(java.security.PrivateKey privateKey)
                                            throws java.security.InvalidKeyException,
                                                   java.security.SignatureException,
                                                   java.security.NoSuchAlgorithmException,
                                                   java.security.cert.CertificateEncodingException
Overrides:
generate in class org.bouncycastle.x509.X509V3CertificateGenerator
Throws:
java.security.InvalidKeyException
java.security.SignatureException
java.security.NoSuchAlgorithmException
java.security.cert.CertificateEncodingException