Top Description Fields Constructors Methods
org.bouncycastle.cert

public Class X509AttributeCertificateHolder

extends Object
implements Encodable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.bouncycastle.util.Encodable
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .OutputStream, .Serializable, java.math.BigInteger, java.util.ArrayList, .Date, .List, .Set, org.bouncycastle.asn1.ASN1Encoding, .ASN1ObjectIdentifier, .ASN1Sequence, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .AttCertValidityPeriod, .Attribute, .AttributeCertificate, .AttributeCertificateInfo, .Extension, .Extensions, org.bouncycastle.operator.ContentVerifier, .ContentVerifierProvider, org.bouncycastle.util.Encodable

Holding class for an X.509 AttributeCertificate structure.

Field Summary

Modifier and TypeField and Description
private transient AttributeCertificate
private static Attribute[]
private transient Extensions
private static final long

Constructor Summary

AccessConstructor and Description
public
X509AttributeCertificateHolder(byte[]
BER/DER encoding of the certificate.
certEncoding
)

Create a X509AttributeCertificateHolder from the passed in bytes.

public
X509AttributeCertificateHolder(AttributeCertificate
an ASN.1 AttributeCertificate structure.
attrCert
)

Create a X509AttributeCertificateHolder from the passed in ASN.1 structure.

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public Attribute[]

Returns:

an array of Attribute, zero length if none present.
getAttributes
()

Return the attributes, if any associated with this request.

public Attribute[]

Returns:

an array of Attribute of the requested type, zero length if none present.
getAttributes
(ASN1ObjectIdentifier
the type of the attribute being looked for.
type
)

Return an array of attributes matching the passed in type OID.

public Set<E>

Returns:

a set of critical extension OIDs.
getCriticalExtensionOIDs
()

Returns a set of ASN1ObjectIdentifier objects representing the OIDs of the critical extensions contained in this holder's attribute certificate.

public byte[]

Returns:

a DER encoded byte array.
getEncoded
()

Implements org.bouncycastle.util.Encodable.getEncoded.

Return the ASN.1 encoding of this holder's attribute certificate.
public Extension

Returns:

the extension if present, null otherwise.
getExtension
(ASN1ObjectIdentifier
the OID of the extension of interest.
oid
)

Look up the extension associated with the passed in OID.

public List<E>

Returns:

a list of extension OIDs.
getExtensionOIDs
()

Returns a list of ASN1ObjectIdentifier objects representing the OIDs of the extensions contained in this holder's attribute certificate.

public Extensions

Returns:

the extensions block, null otherwise.
getExtensions
()

Return the extensions block associated with this certificate if there is one.

public AttributeCertificateHolder

Returns:

this attribute certificate's holder structure.
getHolder
()

Return the holder details for this attribute certificate.

public AttributeCertificateIssuer

Returns:

this attribute certificate's issuer structure,
getIssuer
()

Return the issuer details for this attribute certificate.

public boolean[]
public Set<E>

Returns:

a set of non-critical extension OIDs.
getNonCriticalExtensionOIDs
()

Returns a set of ASN1ObjectIdentifier objects representing the OIDs of the non-critical extensions contained in this holder's attribute certificate.

public Date

Returns:

the final date for the attribute certificate's validity period.
getNotAfter
()

Return the date after which this attribute certificate is not valid.

public Date

Returns:

the start date for the attribute certificate's validity period.
getNotBefore
()

Return the date before which this attribute certificate is not valid.

public BigInteger

Returns:

the serial number.
getSerialNumber
()

Return the serial number of this attribute certificate.

public byte[]

Returns:

the attribute certificate signature bytes.
getSignature
()

Return the bytes making up the signature associated with this attribute certificate.

public AlgorithmIdentifier

Returns:

the AlgorithmIdentifier describing the signature algorithm used to create this attribute certificate.
getSignatureAlgorithm
()

Return the details of the signature algorithm used to create this attribute certificate.

public int
public boolean

Returns:

true if extension are present, false otherwise.
hasExtensions
()

Return whether or not the holder's attribute certificate contains extensions.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
private void
public boolean

Returns:

true if the signature is valid, false otherwise.
isSignatureValid
(ContentVerifierProvider
a ContentVerifierProvider that can generate a verifier for the signature.
verifierProvider
)

Validate the signature on the attribute certificate in this holder.

public boolean

Returns:

true if the attribute certificate is valid, false otherwise.
isValidOn
(Date
the date of interest.
date
)

Return whether or not this attribute certificate is valid on a particular date.

private static AttributeCertificate
parseBytes(byte[] certEncoding)

private void
public AttributeCertificate

Returns:

a AttributeCertificate object.
toASN1Structure
()

Return the underlying ASN.1 structure for the attribute certificate in this holder.

private void
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

attrCertback to summary
private transient AttributeCertificate attrCert
EMPTY_ARRAYback to summary
private static Attribute[] EMPTY_ARRAY
extensionsback to summary
private transient Extensions extensions
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

X509AttributeCertificateHolderback to summary
public X509AttributeCertificateHolder(byte[] certEncoding) throws IOException

Create a X509AttributeCertificateHolder from the passed in bytes.

Parameters
certEncoding:byte[]

BER/DER encoding of the certificate.

Exceptions
IOException:
in the event of corrupted data, or an incorrect structure.
X509AttributeCertificateHolderback to summary
public X509AttributeCertificateHolder(AttributeCertificate attrCert)

Create a X509AttributeCertificateHolder from the passed in ASN.1 structure.

Parameters
attrCert:AttributeCertificate

an ASN.1 AttributeCertificate structure.

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

getAttributesback to summary
public Attribute[] getAttributes()

Return the attributes, if any associated with this request.

Returns:Attribute[]

an array of Attribute, zero length if none present.

getAttributesback to summary
public Attribute[] getAttributes(ASN1ObjectIdentifier type)

Return an array of attributes matching the passed in type OID.

Parameters
type:ASN1ObjectIdentifier

the type of the attribute being looked for.

Returns:Attribute[]

an array of Attribute of the requested type, zero length if none present.

getCriticalExtensionOIDsback to summary
public Set<E> getCriticalExtensionOIDs()

Returns a set of ASN1ObjectIdentifier objects representing the OIDs of the critical extensions contained in this holder's attribute certificate.

Returns:Set<E>

a set of critical extension OIDs.

getEncodedback to summary
public byte[] getEncoded() throws IOException

Implements org.bouncycastle.util.Encodable.getEncoded.

Return the ASN.1 encoding of this holder's attribute certificate.

Returns:byte[]

a DER encoded byte array.

Exceptions
IOException:
if an encoding cannot be generated.
getExtensionback to summary
public Extension getExtension(ASN1ObjectIdentifier oid)

Look up the extension associated with the passed in OID.

Parameters
oid:ASN1ObjectIdentifier

the OID of the extension of interest.

Returns:Extension

the extension if present, null otherwise.

getExtensionOIDsback to summary
public List<E> getExtensionOIDs()

Returns a list of ASN1ObjectIdentifier objects representing the OIDs of the extensions contained in this holder's attribute certificate.

Returns:List<E>

a list of extension OIDs.

getExtensionsback to summary
public Extensions getExtensions()

Return the extensions block associated with this certificate if there is one.

Returns:Extensions

the extensions block, null otherwise.

getHolderback to summary
public AttributeCertificateHolder getHolder()

Return the holder details for this attribute certificate.

Returns:AttributeCertificateHolder

this attribute certificate's holder structure.

getIssuerback to summary
public AttributeCertificateIssuer getIssuer()

Return the issuer details for this attribute certificate.

Returns:AttributeCertificateIssuer

this attribute certificate's issuer structure,

getIssuerUniqueIDback to summary
public boolean[] getIssuerUniqueID()
getNonCriticalExtensionOIDsback to summary
public Set<E> getNonCriticalExtensionOIDs()

Returns a set of ASN1ObjectIdentifier objects representing the OIDs of the non-critical extensions contained in this holder's attribute certificate.

Returns:Set<E>

a set of non-critical extension OIDs.

getNotAfterback to summary
public Date getNotAfter()

Return the date after which this attribute certificate is not valid.

Returns:Date

the final date for the attribute certificate's validity period.

getNotBeforeback to summary
public Date getNotBefore()

Return the date before which this attribute certificate is not valid.

Returns:Date

the start date for the attribute certificate's validity period.

getSerialNumberback to summary
public BigInteger getSerialNumber()

Return the serial number of this attribute certificate.

Returns:BigInteger

the serial number.

getSignatureback to summary
public byte[] getSignature()

Return the bytes making up the signature associated with this attribute certificate.

Returns:byte[]

the attribute certificate signature bytes.

getSignatureAlgorithmback to summary
public AlgorithmIdentifier getSignatureAlgorithm()

Return the details of the signature algorithm used to create this attribute certificate.

Returns:AlgorithmIdentifier

the AlgorithmIdentifier describing the signature algorithm used to create this attribute certificate.

getVersionback to summary
public int getVersion()
hasExtensionsback to summary
public boolean hasExtensions()

Return whether or not the holder's attribute certificate contains extensions.

Returns:boolean

true if extension are present, false otherwise.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

initback to summary
private void init(AttributeCertificate attrCert)
isSignatureValidback to summary
public boolean isSignatureValid(ContentVerifierProvider verifierProvider) throws CertException

Validate the signature on the attribute certificate in this holder.

Parameters
verifierProvider:ContentVerifierProvider

a ContentVerifierProvider that can generate a verifier for the signature.

Returns:boolean

true if the signature is valid, false otherwise.

Exceptions
CertException:
if the signature cannot be processed or is inappropriate.
isValidOnback to summary
public boolean isValidOn(Date date)

Return whether or not this attribute certificate is valid on a particular date.

Parameters
date:Date

the date of interest.

Returns:boolean

true if the attribute certificate is valid, false otherwise.

parseBytesback to summary
private static AttributeCertificate parseBytes(byte[] certEncoding) throws IOException
readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
toASN1Structureback to summary
public AttributeCertificate toASN1Structure()

Return the underlying ASN.1 structure for the attribute certificate in this holder.

Returns:AttributeCertificate

a AttributeCertificate object.

writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException