Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

GlideCertificateEncryption- Global

The GlideCertificateEncryption API provides methods for encrypting certificates.

Use these methods to generate a hash for the certificate, sign data using a private key, and generate a message authentication code.

Parent Topic:Server API reference

GlideCertificateEncryption - GlideCertificateEncryption()

Instantiates a GlideCertificateEncryption object.

NameTypeDescription
None  

Scoped equivalent

To use the GlideCertificateEncryption() constructor in a scoped application, use the corresponding scoped constructor: CertificateEncryption().

GlideCertificateEncryption - generateMac(String key, String algorithm, String data)

Generates the Message Authentication Code (MAC), which is used to authenticate a message.

NameTypeDescription
keyStringKey to use to sign the message. Must be Base64 encoded.
algorithmStringAlgorithm to use to generate the MAC: HmacSHA256, HmacSHA1, HmacMD5, and so on.
dataStringData to process.
TypeDescription
StringMAC in base64 format.
var mac = new GlideCertificateEncryption;
var key = "sample_key"; 
key = GlideStringUtil.base64Encode(key);
mac.generateMac(key, "HmacSHA256", "sample_data");

Scoped equivalent

To use the generateMac() method in a scoped application, use the corresponding scoped method: generateMac().

GlideCertificateEncryption - getThumbPrint(String certificateID, String algorithm)

Generates a hash (SHA-1, SHA-256, and so on) for the certificate from Trust Store Cert.

NameTypeDescription
certificateIDStringsys_id of the certificate record in the X.509 Certificate [sys_certificate] table.
algorithmStringSHA-1, SHA-256, and so on
TypeDescription
StringThumbprint in base64 format.

Scoped equivalent

To use the getThumbPrint() method in a scoped application, use the corresponding scoped method: getThumbPrint().

GlideCertificateEncryption - getThumbPrintFromKeystore(String certificateID, String alias, String algorithm)

Generates a hash (SHA-1, SHA-256, and so on) for the certificate from the key store entry.

NameTypeDescription
certificateIDStringsys_id of the certificate record in the X.509 Certificate [sys_certificate] table.
aliasStringAlias name for the certificate.
algorithmStringSHA-1, SHA-256, and so on.
TypeDescription
StringThumbprint in base64 format.

Scoped equivalent

To use the getThumbPrintFromKeystore() method in a scoped application, use the corresponding scoped method: getThumbPrintFromKeystore().

GlideCertificateEncryption - sign(String certificateID, String alias, String aliaspassword, String algorithm, String datatosign)

Signs the data using the private key and the given algorithm.

NameTypeDescription
certificateIDStringsys_id of the certificate record in the X.509 Certificate [sys_certificate] table.
aliasStringPrivate key name.
aliaspasswordStringPassword for the private key.
datatosignStringData to sign.
algorithmStringSHA-1, SHA-256, and so on.
TypeDescription
StringSigned data in base64 format.
var gce = new GlideCertificateEncryption;
gce.sign("recordID", "alias", "password", "SHA-1", "sign this data");

Scoped equivalent

To use the sign() method in a scoped application, use the corresponding scoped method: sign().