public static X509Certificate getX509Certificate(byte[] certificate) {
        try {
            CertificateFactory factory = CertificateFactory.getInstance("X.509");
            return (X509Certificate) factory.generateCertificate(new ByteArrayInputStream(certificate));
        } catch (Exception e) {
            LOGGER.error("Unable to get certificate from String {}", certificate);
            return null;
        }
    }
Creates an IdentityToken to authenticate with a server.

@param tokenType      the token type
@param securityPolicy the security policy
@return returns an ExtensionObject with an IdentityToken.
plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/context/SecureChannel.java