CertificateEncryption - Scoped
-
- UpdatedFeb 1, 2024
- 2 minutes to read
- Washington DC
- API reference
APIs available for encrypting certificates in scoped applications.
Use these methods to generate a hash for the certificate, sign data using a private key, and generate a message authentication code.
CertificateEncryption - CertificateEncryption()
Instantiates a CertificateEncryption object in a scoped application.
Name | Type | Description |
---|---|---|
None |
CertificateEncryption - generateMac(String key, String algorithm, String data)
Generates the Message Authentication Code (MAC), which is used to authenticate a message.
Name | Type | Description |
---|---|---|
key | String | Key to use to sign the message. Must be Base64 encoded. |
algorithm | String | Algorithm to use to generate the MAC: HmacSHA256, HmacSHA1, HmacMD5, and so on. |
data | String | Data to process. |
Type | Description |
---|---|
String | MAC in base64 format. |
Example
This example shows how to a MAC using sample_key as the data and HmacSHA256 as the algorithm.
CertificateEncryption - getThumbPrint(String certificateID, String algorithm)
Generates a hash (SHA-1, SHA-256, and so on) for the certificate from Trust Store Cert.
Name | Type | Description |
---|---|---|
certificateID | String | Sys_id of the certificate record in the X.509 Certificate [sys_certificate] table. |
algorithm | String | Algorithm to use to create the hash, such as SHA-1, SHA-256, and so on. |
Type | Description |
---|---|
String | Thumbprint in base64 format. |
Example
This example shows how to generate the thumbprint (hash) for the AzureAAD certificate.
Output:
CertificateEncryption - getThumbPrintFromKeyStore(String certificateID, String alias, String algorithm)
Generates a hash (SHA-1, SHA-256, and so on) for the certificate from the keystore entry.
Name | Type | Description |
---|---|---|
certificateID | String | Sys_id of the certificate record in the X.509 Certificate [sys_certificate] table. |
alias | String | Alias name for the certificate. |
algorithm | String | Algorithm to use to create the hash, such as SHA-1, SHA-256, and so on. |
Type | Description |
---|---|
String | Thumbprint in base64 format. |
CertificateEncryption - sign(String certificateID, String alias, String aliaspassword, String algorithm, String datatosign)
Signs the data using the private key and the specified algorithm.
Type | Description |
---|---|
String | Signed data in base64 format. |
Example
On this page
- CertificateEncryption - CertificateEncryption()
- CertificateEncryption - generateMac(String key, String algorithm, String data)
- CertificateEncryption - getThumbPrint(String certificateID, String algorithm)
- CertificateEncryption - getThumbPrintFromKeyStore(String certificateID, String alias,
String algorithm)
- CertificateEncryption - sign(String certificateID, String alias, String aliaspassword,
String algorithm, String datatosign)