class to produce an X.509 Version 2 AttributeCertificate.
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
generate
public X509AttributeCertificate generate(PrivateKey key,
String provider)
throws CertificateEncodingException,
IllegalStateException,
NoSuchProviderException,
SignatureException,
InvalidKeyException,
NoSuchAlgorithmException
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)
throws CertificateEncodingException,
IllegalStateException,
NoSuchProviderException,
NoSuchAlgorithmException,
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.
generateCertificate
public X509AttributeCertificate generateCertificate(PrivateKey key,
String provider)
throws NoSuchProviderException,
SecurityException,
SignatureException,
InvalidKeyException
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)
throws NoSuchProviderException,
SecurityException,
SignatureException,
InvalidKeyException
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.
- an iterator containing recognised names.
reset
public void reset()
reset the generator
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.
signatureAlgorithm
- string representation of the algorithm name.