public class AuthorityInfoAccess extends InfoAccess
AuthorityInfoAccess
Extension.
The AuthorityInfoAccess
extension is a non critical
private internet extension.
The AuthorityInfoAccess extension is associated with a specific certificateExtension
object identifier, derived from:
id-pkix OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) } id-pe OBJECT IDENTIFIER ::= { id-pkix 1 } id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 }
which corresponds to the OID string "1.3.6.1.5.5.5.7.1.1".
The X.509 Certificate and CRL profile presented in RFC 3280 specifies the
AuthorityInfoAccess extension for identifiying how to access CA
information and services for the issuer of the certificate in
which the extension appears.
ASN.1 definition:
AuthorityInfoAccessSyntax ::= SEQUENCE SIZE (1..MAX) OF AccessDescription AccessDescription ::= SEQUENCE { accessMethod OBJECT IDENTIFIER, accessLocation GeneralName }
Each entry in the sequence AuthorityInfoAccessSyntax describes the format and location of additional information about the CA who issued the certificate in which this extension appears. The type and format of the information is specified by the accessMethod field; the accessLocation field specifies the location of the information. The retrieval mechanism may be implied by the accessMethod or specified by accessLocation.
The X.509 PKIX
profile already has defined two accessMethods, id-ad-caIssuers
and id-ad-ocsp, to may be used with the AuthorityInfoAccess extension.
The id-ad-caIssuers accessMethod is used for referencing CAs that have issued certificates
superior to the CA that issued the certificate containing this extension. The
referenced CA Issuers description is intended to aid certificate users in the
selection of a certification path that terminates at a point trusted by the
certificate user.
The id-as-ocsp accessMethod may be used to indicate that revocation information
for the certificate may be obtained by OCSP.
More information can be found in RFC 3280, section 4.2.2.1 "AuthorityInfoAccess".
An AuthorityInfoAccess
object may be created by either using the empty default
constructor, or by directly supplying one access descritption which has to be of
type AccessDescription
, e.g.:
String ocspURL = "http://test.ca.com/ocsp"; AccessDescription ad = new AccessDescription(ObjectID.ocsp, ocspURL); AuthorityInfoAccess authorityInfoAccess = new AuthorityInfoAccess(ad);
Any further access description can be added by using the addAccessDescription
method:
authorityInfoAccess.addAccessDescription(...); ...For adding an
AuthorityInfoAccess
extension object to a X509Certificate, use
the addExtension
method of the X509Certificate
class:
X505Certificate cert = new X509Certificate(); ... cert.addExtension(authorityInfoAccess);
On the receiving side, you may check if an AuthotityInfoAccess extension is included
in a certificate and then look
for
any included AccessDescription, e.g.:
X509Certificate cert = ...; AuthorityInfoAccess authorityInfoAccess = (AuthorityInfoAccess)cert.getExtension(AuthorityInfoAccess.oid); if (authorityInfoAccess != null) { AccessDescription ad = authorityInfoAccess.getAccessDescription(ObjectID.ocsp); if (ad != null) { String ocspURL = ad.getUriAccessLocation(); ... } }
AccessDescription
,
GeneralName
,
ObjectID
,
V3Extension
,
X509Extensions
,
X509Certificate
,
InfoAccess
Modifier and Type | Field and Description |
---|---|
static ObjectID |
oid
The object identifier of this AuthorityInfoAccess extension.
|
critical
Constructor and Description |
---|
AuthorityInfoAccess()
Default constructor.
|
AuthorityInfoAccess(AccessDescription accessDescription)
Creates an
AuthorityInfoAccess object and adds a AccessDescription. |
Modifier and Type | Method and Description |
---|---|
ObjectID |
getObjectID()
Returns the object ID of this
AuthorityInfoAccess extension |
int |
hashCode()
Returns a hashcode for this identity.
|
addAccessDescription, getAccessDescription, getAccessDescriptions, init, removeAllAccessDescriptions, toASN1Object, toString
getName, isCritical, setCritical
public static final ObjectID oid
public AuthorityInfoAccess()
AuthorityInfoAccess
object.
For adding a access description use the addAccessDescription
method. Any AccessDescription to be
added has to be of type iaik.asn1.structures.AccessDescription
, e.g.:
String caCertURL = "http://test.ca.com/cert/caCert.cer"; AccessDescription ad = new AccessDescription(ObjectID.caIssuers, caCertURL); AuthorityInfoAccess authorityInfoAccess = new AuthorityInfoAccess(); authorityInfoAccess.addAccessDescription(ad); ...
AccessDescription
public AuthorityInfoAccess(AccessDescription accessDescription) throws java.lang.IllegalArgumentException
AuthorityInfoAccess
object and adds a AccessDescription.
The AccessDescription to be added has to be of type
iaik.asn1.structures.AccessDescription
, e.g.:
String caCertURL = "http://test.ca.com/cert/caCert.cer"; AccessDescription ad = new AccessDescription(ObjectID.caIssuers, caCertURL); AuthorityInfoAccess authorityInfoAccess = new AuthorityInfoAccess(ad); ...
accessDescription
- the AccessDescription to addjava.lang.IllegalArgumentException
- if a null object is suppliedAccessDescription
public ObjectID getObjectID()
AuthorityInfoAccess
extensiongetObjectID
in class V3Extension
public int hashCode()
hashCode
in class V3Extension