Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

OpenSSL::X509::Store#purpose=

store.purpose = purpose

Sets the store’s default verification purpose. If specified, the verifications on the store will check every certificate’s extensions are consistent with the purpose. The purpose is specified by constants:

  • X509::PURPOSE_SSL_CLIENT

  • X509::PURPOSE_SSL_SERVER

  • X509::PURPOSE_NS_SSL_SERVER

  • X509::PURPOSE_SMIME_SIGN

  • X509::PURPOSE_SMIME_ENCRYPT

  • X509::PURPOSE_CRL_SIGN

  • X509::PURPOSE_ANY

  • X509::PURPOSE_OCSP_HELPER

  • X509::PURPOSE_TIMESTAMP_SIGN

OpenSSL::X509::StoreContext#purpose= can be used to change the value for a single verification operation.

See also the man page X509_VERIFY_PARAM_set_purpose(3).

See also #flags= #set_default_paths #add_path #time= also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0