public class AcceptableResponses extends V3Extension
AcceptableResponses
extension.
As with all OCSP extensions, support of the AcceptableResponses
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
AcceptableResponses
extension
is defined as:
id-pkix-ocsp--response OBJECT IDENTIFIER ::= { id-pkix-ocsp 4 }which corresponds to the OID string "1.3.6.1.5.5.7.48.1.4".
The Online Certificate Status Protocol ( RFC 2560),
RFC 6960)
specifies the AcceptableResponses
extension for allowing an OCSP client to specify the kinds of response types it
understands. This extension is included as one of the requestExtensions in requests
. The OIDs included in AcceptableResponses
are the OIDs of the various response types this client can accept (e.g.,
id-pkix-ocsp-basic).
ASN.1 definition:
AcceptableResponses ::= SEQUENCE OF OBJECT IDENTIFIER
For adding a AcceptableResponses
extension object to a OCSPRequest
, use the addExtension
method, e.g.:
ObjectID[] acceptedResponseTypes = { BasicOCSPResponse.responseType }; AcceptableResponses acceptableResponses = new AcceptableResponses(acceptedResponseTypes); ocspRequest.addExtension(AcceptableResponses);
OCSPRequest
,
V3Extension
,
X509Extensions
Modifier and Type | Field and Description |
---|---|
static ObjectID |
oid
The object identifier of this AcceptableResponses extension.
|
critical
Constructor and Description |
---|
AcceptableResponses()
Default constructor.
|
AcceptableResponses(ObjectID[] acceptableResponseTypes)
Creates a AcceptableResponses extensions for the listed acceptable response OIDs.
|
Modifier and Type | Method and Description |
---|---|
ObjectID[] |
getAcceptableResponseTypes()
Gets the acceptable response type OIDs.
|
ObjectID |
getObjectID()
Returns the object ID of this
AcceptableResponses extension |
int |
hashCode()
Returns a hashcode for this identity.
|
void |
init(ASN1Object obj)
Inits this
AcceptableResponses implementation with an ASN1object
representing the value of this extension. |
boolean |
isResponseTypeAcceptable(ObjectID responseType)
Checks whether the given response type is acceptable or not.
|
void |
setAcceptableResponseTypes(ObjectID[] acceptableResponseTypes)
Sets the acceptable response OIDs.
|
ASN1Object |
toASN1Object()
Returns an ASN1Object representing the value of this
AcceptableResponses extension. |
java.lang.String |
toString()
Returns a string that represents the contents of this
AcceptableResponses extension. |
getName, isCritical, setCritical
public static final ObjectID oid
public AcceptableResponses()
AcceptableResponses
object.
Use methods setAcceptableResponseTypes
for setting the oids of acceptable response types.public AcceptableResponses(ObjectID[] acceptableResponseTypes)
acceptableResponseTypes
- the OIDs of the response types to acceptpublic void setAcceptableResponseTypes(ObjectID[] acceptableResponseTypes)
acceptableResponseTypes
- the OIDs of the response types to acceptpublic ObjectID[] getAcceptableResponseTypes()
public boolean isResponseTypeAcceptable(ObjectID responseType)
true
if the response type is acceptable,
false
if notpublic ObjectID getObjectID()
AcceptableResponses
extensiongetObjectID
in class V3Extension
public void init(ASN1Object obj) throws X509ExtensionException
AcceptableResponses
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
AcceptableResponses 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 AcceptableResponses extension value:
AcceptableResponses ::= SEQUENCE OF OBJECT IDENTIFIER
init
in class V3Extension
obj
- the AcceptableResponses as ASN1Object (SEQUENCE)X509ExtensionException
- if the extension cannot be initialized
from its ASN1 representationpublic ASN1Object toASN1Object()
AcceptableResponses
extension.
The ASN1Object returned by this method will reflect the+ ASN.1 representation of the AcceptableResponses extension value:
AcceptableResponses ::= SEQUENCE OF OBJECT IDENTIFIER
toASN1Object
in class V3Extension
AcceptableResponses
as ASN1Object (SEQUENCE)public int hashCode()
hashCode
in class V3Extension
public java.lang.String toString()
AcceptableResponses
extension.toString
in class java.lang.Object