class RestfulClientProvisioner implements ClientProvisioner {

    RSAPublicKey getACAPublicKey() {
        // request the public key from the ACA
        ResponseEntity<byte[]> response = restTemplate.getForEntity(acaPublicKeyURL, byte[].class);

        try {
            // use the public key information to create encoded key specification. then create a
            X509EncodedKeySpec keySpec = new X509EncodedKeySpec(response.getBody());

            // create the public key from that specification
            return (RSAPublicKey) KeyFactory.getInstance("RSA").generatePublic(keySpec);
        } catch (InvalidKeySpecException | NoSuchAlgorithmException e) {
            throw new ProvisioningException("Encountered error while create Public Key from "
                    + "ACA response: " + e.getMessage(), e);
        }
    }

}