org.bouncycastle.x509

Class X509V2AttributeCertificateGenerator

public class X509V2AttributeCertificateGenerator extends Object

class to produce an X.509 Version 2 AttributeCertificate.
Constructor Summary
X509V2AttributeCertificateGenerator()
Method Summary
voidaddAttribute(X509Attribute attribute)
add an attribute
voidaddExtension(String oid, boolean critical, ASN1Encodable value)
add a given extension field for the standard extensions tag
voidaddExtension(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.
X509AttributeCertificategenerate(PrivateKey key, String provider)
generate an X509 certificate, based on the current issuer and subject, using the passed in provider for the signing.
X509AttributeCertificategenerate(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.
X509AttributeCertificategenerateCertificate(PrivateKey key, String provider)
generate an X509 certificate, based on the current issuer and subject, using the passed in provider for the signing.
X509AttributeCertificategenerateCertificate(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.
IteratorgetSignatureAlgNames()
Return an iterator of the signature names supported by the generator.
voidreset()
reset the generator
voidsetHolder(AttributeCertificateHolder holder)
Set the Holder of this Attribute Certificate
voidsetIssuer(AttributeCertificateIssuer issuer)
Set the issuer
voidsetIssuerUniqueId(boolean[] iui)
voidsetNotAfter(Date date)
voidsetNotBefore(Date date)
voidsetSerialNumber(BigInteger serialNumber)
set the serial number for the certificate.
voidsetSignatureAlgorithm(String signatureAlgorithm)
Set the signature algorithm.

Constructor Detail

X509V2AttributeCertificateGenerator

public X509V2AttributeCertificateGenerator()

Method Detail

addAttribute

public void addAttribute(X509Attribute attribute)
add an attribute

addExtension

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

Throws: IOException

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.

generate

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

generate

public X509AttributeCertificate generate(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.

generateCertificate

public X509AttributeCertificate generateCertificate(PrivateKey key, String provider)

Deprecated: use generate()

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)

Deprecated: use generate()

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.