For the latest news and information visit
The GNU Crypto project

gnu.crypto.pki
Class X509CertificateBuilder

java.lang.Object
  extended by java.security.cert.Certificate
      extended by java.security.cert.X509Certificate
          extended by gnu.crypto.pki.X509CertificateImpl
              extended by gnu.crypto.pki.X509CertificateBuilder
All Implemented Interfaces:
GnuPKIExtension, Serializable, X509Extension

public final class X509CertificateBuilder
extends X509CertificateImpl

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.security.cert.Certificate
Certificate.CertificateRep
 
Field Summary
 
Fields inherited from class gnu.crypto.pki.X509CertificateImpl
algId, algVal, encoded, extensions, ID_DSA, ID_DSA_WITH_SHA1, ID_ECDSA_WITH_SHA1, ID_RSA, ID_RSA_WITH_MD2, ID_RSA_WITH_MD5, ID_RSA_WITH_SHA1, issuer, issuerUniqueId, notAfter, notBefore, serialNo, sigAlgId, sigAlgVal, signature, subject, subjectKey, subjectUniqueId, tbsCertBytes, version
 
Constructor Summary
X509CertificateBuilder()
           
 
Method Summary
 void addExtension(Extension extension)
           
 byte[] getEncoded()
           
 Date getNotAfter()
           
 Date getNotBefore()
           
 byte[] getSignature()
           
 byte[] getTBSCertificate()
           
 void setIssuer(X500Name issuer)
           
 void setIssuer(X500Principal issuer)
           
 void setIssuerUniqueId(BitString issuerUniqueId)
           
 void setNotAfter(Date notAfter)
           
 void setNotBefore(Date notBefore)
           
 void setPublicKey(PublicKey subjectKey)
           
 void setSerialNumber(BigInteger serialNo)
           
 void setSigAlg(String sigAlg)
           
 void setSigParams(byte[] sigAlgVal)
           
 void setSubject(X500Name subject)
           
 void setSubject(X500Principal subject)
           
 void setSubjectUniqueId(BitString subjectUniqueId)
           
 void setVersion(int version)
           
 void sign(PrivateKey key, String sigAlg)
           
 void sign(PrivateKey key, String sigAlg, String provider)
          Signs this certificate, encoding it and preparing for a call to getEncoded().
 
Methods inherited from class gnu.crypto.pki.X509CertificateImpl
checkValidity, checkValidity, equals, getBasicConstraints, getCriticalExtensionOIDs, getExtendedKeyUsage, getExtension, getExtensions, getExtensionValue, getIssuerAlternativeNames, getIssuerDN, getIssuerUniqueID, getIssuerX500Principal, getKeyUsage, getNonCriticalExtensionOIDs, getPublicKey, getSerialNumber, getSigAlgName, getSigAlgOID, getSigAlgParams, getSubjectAlternativeNames, getSubjectDN, getSubjectUniqueID, getSubjectX500Principal, getVersion, hasUnsupportedCriticalExtension, toString, verify, verify
 
Methods inherited from class java.security.cert.Certificate
getType, hashCode, writeReplace
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

X509CertificateBuilder

public X509CertificateBuilder()
Method Detail

getEncoded

public byte[] getEncoded()
                  throws CertificateEncodingException
Overrides:
getEncoded in class X509CertificateImpl
Throws:
CertificateEncodingException

getNotBefore

public Date getNotBefore()
Overrides:
getNotBefore in class X509CertificateImpl

getNotAfter

public Date getNotAfter()
Overrides:
getNotAfter in class X509CertificateImpl

getSignature

public byte[] getSignature()
Overrides:
getSignature in class X509CertificateImpl

getTBSCertificate

public byte[] getTBSCertificate()
                         throws CertificateEncodingException
Overrides:
getTBSCertificate in class X509CertificateImpl
Throws:
CertificateEncodingException

setVersion

public void setVersion(int version)

setSerialNumber

public void setSerialNumber(BigInteger serialNo)

setIssuer

public void setIssuer(X500Name issuer)

setIssuer

public void setIssuer(X500Principal issuer)
               throws IOException
Throws:
IOException

setNotBefore

public void setNotBefore(Date notBefore)

setNotAfter

public void setNotAfter(Date notAfter)

setSubject

public void setSubject(X500Name subject)

setSubject

public void setSubject(X500Principal subject)
                throws IOException
Throws:
IOException

setPublicKey

public void setPublicKey(PublicKey subjectKey)

setIssuerUniqueId

public void setIssuerUniqueId(BitString issuerUniqueId)

setSubjectUniqueId

public void setSubjectUniqueId(BitString subjectUniqueId)

addExtension

public void addExtension(Extension extension)

setSigAlg

public void setSigAlg(String sigAlg)

setSigParams

public void setSigParams(byte[] sigAlgVal)

sign

public void sign(PrivateKey key,
                 String sigAlg,
                 String provider)
          throws CertificateException,
                 InvalidKeyException,
                 NoSuchAlgorithmException,
                 NoSuchProviderException,
                 SignatureException
Signs this certificate, encoding it and preparing for a call to getEncoded().

Throws:
CertificateException
InvalidKeyException
NoSuchAlgorithmException
NoSuchProviderException
SignatureException

sign

public void sign(PrivateKey key,
                 String sigAlg)
          throws CertificateException,
                 InvalidKeyException,
                 NoSuchAlgorithmException,
                 SignatureException
Throws:
CertificateException
InvalidKeyException
NoSuchAlgorithmException
SignatureException

For the latest news and information visit
The GNU Crypto project

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.