public class ServiceLocator extends V3Extension
ServiceLocator
(CRL References) extension.
As with all OCSP extensions, support of the ServiceLocator
extension
is optional for client and servers. The critical flag should not be set.
Each OCSP extension is associated with a specific ocsp extension
object identifier, derived from RFC 2560,
RFC 6960:
id-pkix OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) } id-ad OBJECT IDENTIFIER ::= { id-pkix 48 } -- arc for access descriptors id-ad-ocsp OBJECT IDENTIFIER ::= { id-ad 1 } id-pkix-ocsp OBJECT IDENTIFIER ::= { id-ad-ocsp }The object identifier for the
ServiceLocator
extension
is defined as:
id-pkix-ocsp-service-locator OBJECT IDENTIFIER ::= { id-pkix-ocsp 7 }which corresponds to the OID string "1.3.6.1.5.5.7.48.1.7".
The Online Certificate Status Protocol
( RFC 2560),
RFC 6960) specifies the
ServiceLocator extension for allowing a server to support forwarding
of received request to the OCSP server which is known to be authoritative
for the identified certificate. For this purpose the ServiceLocator
extension my be included as one of the singleRequestExtensions in requests
.
ASN.1 definition:
ServiceLocator ::= SEQUENCE { issuer Name, locator AuthorityInfoAccessSyntax OPTIONAL }Values for these fields are obtained from the corresponding fields in the subject certificate.
For adding a ServiceLocator
extension object to a Request
, use the addExtension
method, e.g.:
Name issuer = cert.getIssuerDN(); AuthorityInfoAccess locator = (AuthorityInfoAccess)cert.getExtension(AuthorityInfoAccess.oid); ServiceLocator serviceLocator = new ServiceLocator(issuer); serviceLocator.setLocator(locator); request.addExtension(serviceLocator);
Request
,
V3Extension
,
X509Extensions
Modifier and Type | Field and Description |
---|---|
static ObjectID |
oid
The object identifier of this ServiceLocator extension.
|
critical
Constructor and Description |
---|
ServiceLocator()
Default constructor.
|
ServiceLocator(Name issuer)
Creates a ServiceLocator extension from the given issuer name.
|
Modifier and Type | Method and Description |
---|---|
Name |
getIssuer()
Gets the issuer name of this ServiceLocator extension.
|
AuthorityInfoAccess |
getLocator()
Gets the locator.
|
ObjectID |
getObjectID()
Returns the object ID of this
ServiceLocator extension |
int |
hashCode()
Returns a hashcode for this identity.
|
void |
init(ASN1Object obj)
Inits this
ServiceLocator implementation with an ASN1object
representing the value of this extension. |
void |
setIssuer(Name issuer)
Sets the issuer name of this ServiceLocator extension.
|
void |
setLocator(AuthorityInfoAccess locator)
Stets the locator.
|
ASN1Object |
toASN1Object()
Returns an ASN1Object representing the value of this
ServiceLocator extension. |
java.lang.String |
toString()
Returns a string that represents the contents of this
ServiceLocator extension. |
getName, isCritical, setCritical
public static final ObjectID oid
public ServiceLocator()
public ServiceLocator(Name issuer)
issuer
- the name of the issuerpublic void setIssuer(Name issuer)
issuer
- the name of the issuerpublic Name getIssuer()
public void setLocator(AuthorityInfoAccess locator)
locator
- the locator AuthorityInfoAccess specifying the
authorized responder of the certificate in mindpublic AuthorityInfoAccess getLocator()
public ObjectID getObjectID()
ServiceLocator
extensiongetObjectID
in class V3Extension
public void init(ASN1Object obj) throws X509ExtensionException
ServiceLocator
implementation with an ASN1object
representing the value of this extension.
The given ASN1Object is the one created by toASN1Object()
.
This method is used by the X509Extensions
class when parsing the ASN.1 representation
of a OCSP object for properly initializing an included
ServiceLocator extension. This method initializes the
extension only with its value, but not with its critical
specification. For that reason, this method shall not be
explicitly called by an application.
The ASN1Object supplied to this method will reflect the ASN.1 representation of the ServiceLocator extension value:
ServiceLocator ::= SEQUENCE { issuer Name, locator AuthorityInfoAccessSyntax OPTIONAL }
init
in class V3Extension
obj
- the ServiceLocator as ASN1Object (SEQUENCE)X509ExtensionException
- if the extension cannot be initialized
from its ASN1 representationpublic ASN1Object toASN1Object() throws X509ExtensionException
ServiceLocator
extension.
The ASN1Object returned by this method will reflect the ASN.1 representation of the ServiceLocator extension value:
ServiceLocator ::= SEQUENCE { issuer Name, locator AuthorityInfoAccessSyntax OPTIONAL }
toASN1Object
in class V3Extension
ServiceLocator
as ASN1Object (SEQUENCE)X509ExtensionException
- if the extension could not be createdpublic int hashCode()
hashCode
in class V3Extension
public java.lang.String toString()
ServiceLocator
extension.toString
in class java.lang.Object