Module ocsp

OCSP module for lua-openssl binding Generate, sign, process OCSP request and response.

Usage:

    ocsp = require'openssl'.ocsp
    

Functions

certid_new (certificate_or_serialNumber, issuer[, md_alg=sha256]) create a new ocsp certid object.
request_new ([nonce]) create a new ocsp request object.
request_read (input[, pem=false]) read ocsp_request object from string or bio data
read (content[, pem=false]) read openssl.ocsp_response object from string or bio object
basicresp_new () create a new openssl.ocsp_basicresp object

Class openssl.ocsp_certid

openssl.ocsp_certid.info table which openssl.ocsp_certid:info returned
openssl.ocsp_certid:info () get the certid info table.

Class openssl.ocsp_request

openssl.ocsp_request:add (certid) add a ocsp_certid
openssl.ocsp_request:add_ext (extension[, location]) add a x509_extension
openssl.ocsp_request:export ([pem=false]) export a ocsp_request object to encoded data
openssl.ocsp_request:is_signed () ocsp_request is_signed or not
openssl.ocsp_request:sign (signer, pkey[, others[, flags=0[, digest='sha256']]]) sign ocsp_request object
openssl.ocsp_request:parse (request) parse openssl.ocsp_request, and return a table

Class openssl.ocsp_singleresp

openssl.ocsp_singleresp:add_ext (extension) add openssl.x509_extension object to openssl.ocsp_singleresp
openssl.ocsp_singleresp:info () get a table containing certificate status information

Class openssl.ocsp_basicresp

openssl.ocsp_basicresp:add (certid, status, reason[, revokedTime]) add one status item to openssl.ocsp_bascresp, return opessl.ocsp_singleresp
openssl.ocsp_basicresp:add_ext (extension[, location]) add one openssl.x509_extension to openssl.ocsp_bascresp
openssl.ocsp_basicresp:sign (cert, pkey[, digest=sha256[, array[, flag=0]]]) sign then to openssl.ocsp_bascresp
openssl.ocsp_basicresp:info () get openssl.ocsp_bascresp info table
openssl.ocsp_basicresp:copy_nonce (request) copy nonce from openssl.ocsp_request to openssl.ocsp_bascresp
openssl.ocsp_basicresp:response ([status=0]) create openssl.ocsp_response object

Class openssl.ocsp_response

openssl.ocsp_response:export ([pem=false]) export openssl.ocsp_response an encoded string
openssl.ocsp_response:export () get parsed information table from openssl.ocsp_response object


Functions

certid_new (certificate_or_serialNumber, issuer[, md_alg=sha256])
create a new ocsp certid object.

Parameters:

  • certificate_or_serialNumber openssl.x509 or openssl.bn
  • issuer openssl.x509
  • md_alg openssl.digest (default sha256)

Returns:

    openssl.ocsp_certid
request_new ([nonce])
create a new ocsp request object.

Parameters:

Returns:

    openssl.ocsp_request
request_read (input[, pem=false])
read ocsp_request object from string or bio data

Parameters:

  • input string or bio
  • pem boolean , true for PEM, false for DER (default false)

Returns:

    openssl.ocsp_request
read (content[, pem=false])
read openssl.ocsp_response object from string or bio object

Parameters:

  • content string or bio
  • pem boolean , true for PEM, false for DER (default false)

Returns:

    openssl.ocsp_response
basicresp_new ()
create a new openssl.ocsp_basicresp object

Returns:

    openssl.ocsp_basicresp

Class openssl.ocsp_certid

A openssl.ocsp_certid class.
openssl.ocsp_certid.info
table which openssl.ocsp_certid:info returned

Fields:

  • hashAlgorith
  • issuerNameHash
  • issuerKeyHash
  • serialNumber
openssl.ocsp_certid:info ()
get the certid info table.

Returns:

    openssl.ocsp_certid.info

Class openssl.ocsp_request

A openssl.ocsp_request class.
openssl.ocsp_request:add (certid)
add a ocsp_certid

Parameters:

  • certid openssl.ocsp_certid

Returns:

    openssl.ocsp_onereq
openssl.ocsp_request:add_ext (extension[, location])
add a x509_extension

Parameters:

  • extension openssl.x509_extension
  • location integer (optional)

Returns:

    boolean
openssl.ocsp_request:export ([pem=false])
export a ocsp_request object to encoded data

Parameters:

  • pem boolean true for PEM and false for DER (default false)

Returns:

    string
openssl.ocsp_request:is_signed ()
ocsp_request is_signed or not

Returns:

    boolean
openssl.ocsp_request:sign (signer, pkey[, others[, flags=0[, digest='sha256']]])
sign ocsp_request object

Parameters:

  • signer x509
  • pkey evp_pkey
  • others certificates in ocsp_request (optional)
  • flags integer (default 0)
  • digest (default 'sha256')

Returns:

    boolean
openssl.ocsp_request:parse (request)
parse openssl.ocsp_request, and return a table

Parameters:

  • request openssl.ocsp_request

Returns:

    table

Class openssl.ocsp_singleresp

A openssl.ocsp_singleresp class.
openssl.ocsp_singleresp:add_ext (extension)
add openssl.x509_extension object to openssl.ocsp_singleresp

Parameters:

  • extension openssl.x509_extension

Returns:

    boolean
openssl.ocsp_singleresp:info ()
get a table containing certificate status information

Returns:

    table

Class openssl.ocsp_basicresp

A openssl.ocsp_basicresp class.
openssl.ocsp_basicresp:add (certid, status, reason[, revokedTime])
add one status item to openssl.ocsp_bascresp, return opessl.ocsp_singleresp

Parameters:

  • certid openssl.ocsp_certid
  • status integer
  • reason integer
  • revokedTime integer (optional)

Returns:

    openssl.ocsp_singleresp
openssl.ocsp_basicresp:add_ext (extension[, location])
add one openssl.x509_extension to openssl.ocsp_bascresp

Parameters:

  • extension openssl.x509_extension
  • location integer (optional)

Returns:

    boolean
openssl.ocsp_basicresp:sign (cert, pkey[, digest=sha256[, array[, flag=0]]])
sign then to openssl.ocsp_bascresp

Parameters:

  • cert openssl.x509
  • pkey openssl.evp_pkey
  • digest openssl.digest (default sha256)
  • array table (optional)
  • flag integer (default 0)

Returns:

    boolean
openssl.ocsp_basicresp:info ()
get openssl.ocsp_bascresp info table

Returns:

    table
openssl.ocsp_basicresp:copy_nonce (request)
copy nonce from openssl.ocsp_request to openssl.ocsp_bascresp

Parameters:

  • request openssl.ocsp_request

Returns:

    table
openssl.ocsp_basicresp:response ([status=0])
create openssl.ocsp_response object

Parameters:

  • status integer (default 0)

Returns:

    openssl.ocsp_response

Class openssl.ocsp_response

A openssl.ocsp_response class.
openssl.ocsp_response:export ([pem=false])
export openssl.ocsp_response an encoded string

Parameters:

  • pem boolean true for PEM, false for DER (default false)

Returns:

    string
openssl.ocsp_response:export ()
get parsed information table from openssl.ocsp_response object

Returns:

    table
generated by LDoc 1.5.0 Last updated 2024-05-16 23:31:39