org.bouncycastle.x509

Class X509V2AttributeCertificateGenerator


public class X509V2AttributeCertificateGenerator
extends java.lang.Object

class to produce an X.509 Version 2 AttributeCertificate.

Constructor Summary

X509V2AttributeCertificateGenerator()

Method Summary

void
addAttribute(X509Attribute attribute)
add an attribute
void
addExtension(String OID, boolean critical, byte[] value)
add a given extension field for the standard extensions tag The value parameter becomes the contents of the octet string associated with the extension.
void
addExtension(String OID, boolean critical, ASN1Encodable value)
add a given extension field for the standard extensions tag
X509AttributeCertificate
generateCertificate(PrivateKey key, String provider)
generate an X509 certificate, based on the current issuer and subject, using the passed in provider for the signing.
X509AttributeCertificate
generateCertificate(PrivateKey key, String provider, SecureRandom random)
generate an X509 certificate, based on the current issuer and subject, using the passed in provider for the signing and the supplied source of randomness, if required.
Iterator
getSignatureAlgNames()
Return an iterator of the signature names supported by the generator.
void
reset()
reset the generator
void
setHolder(AttributeCertificateHolder holder)
Set the Holder of this Attribute Certificate
void
setIssuer(AttributeCertificateIssuer issuer)
Set the issuer
void
setIssuerUniqueId(boolean[] iui)
void
setNotAfter(Date date)
void
setNotBefore(Date date)
void
setSerialNumber(BigInteger serialNumber)
set the serial number for the certificate.
void
setSignatureAlgorithm(String signatureAlgorithm)
Set the signature algorithm.

Constructor Details

X509V2AttributeCertificateGenerator

public X509V2AttributeCertificateGenerator()

Method Details

addAttribute

public void addAttribute(X509Attribute attribute)
add an attribute


addExtension

public void addExtension(String OID,
                         boolean critical,
                         byte[] value)
add a given extension field for the standard extensions tag The value parameter becomes the contents of the octet string associated with the extension.


addExtension

public void addExtension(String OID,
                         boolean critical,
                         ASN1Encodable value)
            throws IOException
add a given extension field for the standard extensions tag


generateCertificate

public X509AttributeCertificate generateCertificate(PrivateKey key,
                                                    String provider)
            throws NoSuchProviderException,
                   SecurityException,
                   SignatureException,
                   InvalidKeyException
generate an X509 certificate, based on the current issuer and subject, using the passed in provider for the signing.


generateCertificate

public X509AttributeCertificate generateCertificate(PrivateKey key,
                                                    String provider,
                                                    SecureRandom random)
            throws NoSuchProviderException,
                   SecurityException,
                   SignatureException,
                   InvalidKeyException
generate an X509 certificate, based on the current issuer and subject, using the passed in provider for the signing and the supplied source of randomness, if required.


getSignatureAlgNames

public Iterator getSignatureAlgNames()
Return an iterator of the signature names supported by the generator.

Returns:
an iterator containing recognised names.


reset

public void reset()
reset the generator


setHolder

public void setHolder(AttributeCertificateHolder holder)
Set the Holder of this Attribute Certificate


setIssuer

public void setIssuer(AttributeCertificateIssuer issuer)
Set the issuer


setIssuerUniqueId

public void setIssuerUniqueId(boolean[] iui)


setNotAfter

public void setNotAfter(Date date)


setNotBefore

public void setNotBefore(Date date)


setSerialNumber

public void setSerialNumber(BigInteger serialNumber)
set the serial number for the certificate.


setSignatureAlgorithm

public void setSignatureAlgorithm(String signatureAlgorithm)
Set the signature algorithm. This can be either a name or an OID, names are treated as case insensitive.

Parameters:
signatureAlgorithm - string representation of the algorithm name.