dw.crypto
Class CertificateUtils

Utilities for managing certificates and keys.
Constructor Summary
Method Summary
static getCertificate(certificateRef
:
CertificateRef)
:
X509Certificate
Gets the certificate from the given certificate reference.
static getCertificate(keyRef
:
KeyRef)
:
X509Certificate
Gets the public certificate from the given private key reference.
static getEncodedCertificate(certificateRef
:
CertificateRef)
:
String
Encode the certificate to the base64-encoded DER format.
static getEncodedPublicKey(certificateRef
:
CertificateRef)
:
String
Gets the public key from the given certificate reference.
static parseEncodedCertificate(certificate
:
String)
:
CertificateRef
Parse the certificate from the base64-encoded DER format.
static parseEncodedPublicKey(algorithm
:
String, encodedKey
:
String)
:
CertificateRef
Parse the public key from the given key in X.509 SubjectPublicKeyInfo format.
static parsePublicKeyFromJWK(jwk
:
String)
:
CertificateRef
Parse the public key from the given base64-encoded JWK string.
Methods inherited from class
Object
assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values
Method Detail
getCertificate
Gets the certificate from the given certificate reference.
Parameters:
certificateRef
-
the certificate reference
Returns:
The X509Certificate
Throws:
Exception
-
if the reference is invalid or does not refer to an X.509 certificate
getCertificate
Gets the public certificate from the given private key reference.
Parameters:
keyRef
-
the key reference
Returns:
The X509Certificate
Throws:
Exception
-
if the reference is invalid or there is no X.509 certificate
getEncodedCertificate
Encode the certificate to the base64-encoded DER format.
Parameters:
certificateRef
-
the certificate to encode
Returns:
base64-encoded DER certificate
getEncodedPublicKey
Gets the public key from the given certificate reference.
It is exported in the standard X.509 SubjectPublicKeyInfo format and base64-encoded.
Parameters:
certificateRef
-
the certificate reference with the public key to encode
Returns:
The encoded public key
parseEncodedCertificate
Parse the certificate from the base64-encoded DER format.
Parameters:
certificate
-
The encoded certificate
Returns:
Reference to the parsed certificate
parseEncodedPublicKey
Parse the public key from the given key in X.509 SubjectPublicKeyInfo format.
The resulting reference contains only the public key. It can be used for cryptographic operations, but not anything that requires the full certificate.
Parameters:
algorithm
-
The public key algorithm, either
EC
or RSA
encodedKey
-
The encoded key
Returns:
Reference to the public key
parsePublicKeyFromJWK
Parse the public key from the given base64-encoded JWK string.
This returns the public key portion of the JWK, not the x5c
certificate chain.
Only RSA and EC keys are supported.
The resulting reference contains only the public key. It can be used for cryptographic operations, but not anything that requires the full certificate.
Parameters:
jwk
-
Encoded JWK
Returns:
Reference to the public key
© Copyright 2000-2025, salesforce.com inc. All rights reserved. Various trademarks held by their respective owners.