/** * This method loads a certificate from the given location. The certificate must be DER-encoded and may be supplied * in binary or printable (PEM / Base64) encoding. * * If the certificate is provided in Base64 encoding, it must be bounded at the beginning by * {@code -----BEGIN CERTIFICATE-----}, and must be bounded at the end by {@code -----END CERTIFICATE-----}. * * @param file * the file with the certificate * @return the certificate token */ public static CertificateToken loadCertificate(final File file) { final InputStream inputStream = DSSUtils.toByteArrayInputStream(file); return loadCertificate(inputStream); }