SetaPDF_Signer_Ocsp_Response Class representing an OCSPResponse structure.

File: /SetaPDF v2/Signer/Ocsp/Response.php

OCSPResponse ::= SEQUENCE { responseStatus OCSPResponseStatus, responseBytes [0] EXPLICIT ResponseBytes OPTIONAL }

OCSPResponseStatus ::= ENUMERATED { successful (0), --Response has valid confirmations malformedRequest (1), --Illegal confirmation request internalError (2), --Internal error in issuer tryLater (3), --Try again later --(4) is not used sigRequired (5), --Must sign the request unauthorized (6) --Request unauthorized }

Class hierarchy

Summary

Constants

STATUS_INTERNAL_ERROR

Status constant.

STATUS_MALFORMED_REQUEST

Status constant.

STATUS_SIG_REQUIRED

Status constant.

STATUS_SUCCESSFUL

Status constant.

STATUS_TRY_LATER

Status constant.

STATUS_UNAUTHORIZED

Status constant.


Static Properties

$usePhpseclibForRsaPss

Flag defining whether usage of phpseclib or default OpenSSL methods for RSA_PSS validation.

$verifyCallback

static public null|callable SetaPDF_Signer_Asn1_Signed::$verifyCallback

A callable that can be used to implement individual verification logic.


Properties

$_basicResponse

The basic response element if available.

$_response

$_singleResponses


Methods

__construct()

public SetaPDF_Signer_Ocsp_Response::__construct (
string $response
)

The constructor.

Parameters
$response : string
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws InvalidArgumentException

_getBasicResponse()

_getExtension()

Get an extension from the response by its OID.

Parameters
$extensionOid : string
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws SetaPDF_Signer_Exception

_getResponseData()

get()

public SetaPDF_Signer_Ocsp_Response::get (
void
): string

Get the response as an ASN.1 string.

getAsn1()

Get the ASN.1 instance of the OCSP response.

getCertificates()

Get all certificates embedded in the response.

Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws SetaPDF_Signer_Exception

getNonce()

public SetaPDF_Signer_Ocsp_Response::getNonce (
void
): bool|string

Get the nonce value from the response.

Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws SetaPDF_Signer_Exception

getProducedAt()

Get the producedAt information.

Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws SetaPDF_Signer_Exception

getResponderId()

public SetaPDF_Signer_Ocsp_Response::getResponderId (
void
): string|null

Get the responder id from the responder data.

Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws SetaPDF_Signer_Exception

getSignatureAlgorithm()

getSignatureValue()

public SetaPDF_Signer_Ocsp_Response::getSignatureValue (
[ bool $hex = true ]
): string|null
Parameters
$hex : bool
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws SetaPDF_Signer_Exception

getSignedData()

public SetaPDF_Signer_Ocsp_Response::getSignedData (
void
): bool|string
Exceptions

Throws SetaPDF_Signer_Exception

getSingleResponses()

Get the single responses from the response.

Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws SetaPDF_Signer_Exception

getStatus()

Get the status of the response.

Return Values

See self::STATUS_* constants.

Exceptions

Throws SetaPDF_Signer_Exception

isGood()

public SetaPDF_Signer_Ocsp_Response::isGood (
void
): bool

Checks if this response object is "good".

Evaluates to true if the status of the whole response is self::STATUS_SUCCESSFUL and the certificate status of all single responses are SingleResponse::CERT_STATUS_GOOD.

Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws SetaPDF_Signer_Exception

verify()

Verify the signed object.

Parameters
$signerCertificate : SetaPDF_Signer_X509_Certificate
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws SetaPDF_Signer_Exception

withoutCertificates()

This method returns a new instance with the certs field removed in the BasicOCSPResponse.

Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws SetaPDF_Signer_Exception