![]() |
![]()
| ![]() |
![]()
OpenXPKI::Template::Plugin::CertificatePlugin for Template::Toolkit to retrieve properties of a certificate by the certificate identifier. All methods require the cert_identifier as first argument. How to useYou need to load the plugin into your template before using it. As we do not export the methods, you need to address them with the plugin name, e.g. [% USE Certificate %] Your certificate with the serial [% Certificate.serial(cert_identifier) %] was issued by [% Certificate.body(cert_identifier, 'issuer') %] Will result in Your certificate with the serial 439228933522281479442943 was issued by CN=CA ONE,OU=Test CA,DC=OpenXPKI,DC=ORG get_hash(cert_identifier)Return the certificates database hash or undef if the identifier is not found. body(cert_identifier, property)Return a selected property from the certificate body. All fields returned by the get_cert API method are allowed, the property name is always uppercased. Note that some properties might return a hash or an array ref! If the key (or the certificate) is not found, undef is returned. csr_serialReturns the csr_serial. serialReturns the certificate serial number in decimal notation. This is a shortcut for body(cert_id, 'serial'); serial_hexReturns the certificate serial number in decimal notation. This is a shortcut for body(cert_id, 'serial_hex'); subjectReturns the certificate subject as string This is a shortcut for body(cert_id, 'subject'); statusReturns the certificate status. issuerReturns the identifier of the issuer certifcate. key_idReturns the subject key identifier of the certifcate. dnReturns the DN of the certificate as parsed hash, if second parameter is given returns the named part as string. Note: In case the named property has more than one item, only the first one is returned! notbefore(cert_identifier, format)Return the notbefore date in given format. Format can be any string accepted by OpenXPKI::DateTime, default is UTC format (iso8601). notafter(cert_identifier, format)Return the notafter date in given format. Format can be any string accepted by OpenXPKI::DateTime, default is UTC format (iso8601). cdpReturn the URIs of the CDPs contained in the certificate as arrayref. pki_realmReturn the verbose label of the workflow realm chain(cert_identifier)Return the chain of the certificate as array. The first element is the certificate issuer, the root ca is the last. attr(cert_identifier, attribute_name)Return the value(s) of the requested attribute. Note that the return value is always an array ref. pem(cert_identifier)Return the PEM encoded certificate profile(cert_identifier)Return the internal name of the profile
|