OpenSSL x509 Certificates


Encryption Resources

Name -- Syntax / Description
x509_create
x509_create( cert, x509 var )
Create an X509 Certificate from the PEM format data in "cert" where cert = PEM format certificate, x509 =Index into an internal array of certificates.
Returns 1 on sucess, 0 on error.
x509_free
x509_free( rsa var )
Deletes an x509 from the internal array of x509 certificates where x509 = Index into internal array of x509 certificates.
Returns 1 on success, 0 on error.
x509_load
x509_load( cert, x509 var )
Load an X509 Certificate from the file specified by "cert" where cert = File containing an x509 certificate, x509 = Index into an internal array of certificates.
Returns 1 on sucess, 0 on error.
x509_rsa_publickey
x509_rsa_publickey( x509 var, rsa var )
Extracts the RSA public key from the X509 specified by "x509" and stores it in "rsa" where x509 = Index into internal array of x509 certificates, rsa =Index into internal array of RSA public keys.
Returns 1 on success, 0 on error.
x509_verify
x509_verify( x509 var, trusted_certs )
Verifies that the X509 certificate specified by "x509" was issued by one of the X509 certificates (in PEM format) in "trusted_certs", where x509 = Index into internal array of certificates, trusted_certs = Certificates (in PEM text format) to find the x50
Returns 1 on successful find, 0 if certificate isn't in trusted_certs, or other error.
x509_load_mem
x509_load_mem( cert, x509 var )
Loads and parses the text of an x509 certificate, and gives a certificate reference that refers to the certificate in internal storage.
Returns 1 on success, 0 on failure
  • cert = Text of the certificate
  • x509 = Certificate reference. On success, this will be neither zero nor null
x509_get_subject_name
x509_get_subject_name( certref var, subjectname var )
Return X509 name information for the certificate referred to by the certificate reference.
Returns 1 on success, 0 on failure
  • certref = Certificate reference returned from functions such as x509_load_mem
  • subjectname = Structure with members named for the entry names (e.g., "commonName", "countryName", etc.)
x509_get_issuer_name
x509_get_issuer_name( certref var, issuername var )
Return X509 issuer information for the certificate referred to by the certificate reference.
Returns 1 on success, 0 on failure
  • certref = Certificate reference returned from functions such as x509_load_mem
  • issuername = Structure with members named for the entry names (e.g., "commonName", "countryName", etc.)
x509_get_extensions
x509_get_extensions( certref var, extensions var )
Return X509 extension information for the certificate referred to by the certificate reference.
Returns 1 on success, 0 on failure
  • certref = Certificate reference returned from functions such as x509_load_mem
  • extensions = Structure with members named for the entry names (e.g., "data", "oid", etc.)
x509_digest
x509_digest( x509 var, digestname, digest var )
Return the digest of the given certificate referred to by the certificate reference, using the specified hash algorithm.
Returns 1 on success, 0 on failure
  • x509 = Certificate reference returned from functions such as x509_load_mem
  • digestname = Hash algorithm name, such as "md5" or "sha256". Supported digest algorithms will vary between OpenSSL installations
  • digest = Hash value of the certificate
x509_pubkey_digest
x509_pubkey_digest( x509 var, digestname, digest var )
Return the digest of the public key portion of the given certificate referred to by the certificate reference, using the specified hash algorithm.
Returns 1 on success, 0 on failure
  • x509 = Certificate reference returned from functions such as x509_load_mem
  • digestname = Hash algorithm name, such as "md5" or "sha256". Supported digest algorithms will vary between OpenSSL installations
  • digest = Hash value of the public key of the certificate
pkcs7_load_mem
pkcs7_load_mem( cert, format, pkcs7 var )
Load a list of PKCS7 structures in the specified format into memory, and return a structure reference that refers to the structure(s) in internal storage.
Returns 1 on success, 0 on failure
  • cert = Text of a list of pkcs7 structures
  • format = Format of the structure(s) passed in. Valid values are "der", "pem", or "pkcs12", with "der" used if the format is missing or any other values are passed
  • pkcs7 = Structure array reference. On success, this will be neither zero nor null
pkcs7_get_certs
pkcs7_get_certs( pkcs7 var, x509s var )
Given a structure reference such as returned from pkcs7_load_mem, return certificate references for the x509 certificates that are embedded therein.
Returns Count of array elements returned, -1 on failure
  • pkcs7 = Structure reference
  • x509s = Array of x509 certificate references
pkcs7_verify
pkcs7_verify( pkcs7 var, root_x509 var, content )
Given a pkcs7 structure reference and root x509 certificate reference, verify the pkcs7 structure and the signed content (if provided).
Returns 1 on success, 0 on failure
  • pkcs7 = PKCS7 structure reference
  • root_x509 = Root x509 certificate reference
  • content = Optional content if not present in the PKCS structure
pkcs7_free
pkcs7_free( pkcs7 var )
Remove a pkcs7 structure from internal memory. The passed pkcs7 structure reference is unchanged on failure (invalid reference) or set to 0 on success.
Returns 1 on success, 0 on failure
  • pkcs7 = PKCS7 structure reference
User Annotations: x509