CertificateToken extends Token { public X509Certificate getCertificate() { return x509Certificate; } CertificateToken(X509Certificate x509Certificate); @Override String getAbbreviation(); EntityIdentifier getEntityKey(); PublicKey getPublicKey(); Date getNotAfter(); Date getNotBefore(); @Override Date getCreationDate(); boolean isValidOn(final Date date); @Override boolean isSelfSigned(); boolean isSelfIssued(); boolean isEquivalent(CertificateToken token); X509Certificate getCertificate(); @Override byte[] getEncoded(); BigInteger getSerialNumber(); X500PrincipalHelper getSubject(); X500PrincipalHelper getIssuer(); @Override X500Principal getIssuerX500Principal(); boolean checkKeyUsage(final KeyUsageBit keyUsageBit); @Override String toString(String indentStr); List<KeyUsageBit> getKeyUsageBits(); boolean isCA(); byte[] getSignature();  }
@Test public void pss() throws IOException { Security.addProvider(new BouncyCastleProvider()); File certFile = new File("src/test/resources/D-TRUST_CA_3-1_2016.cer"); try (FileInputStream fis = new FileInputStream(certFile)) { CertificateToken certificate = getCertificate(fis); assertNotNull(certificate); assertEquals(SignatureAlgorithm.RSA_SSA_PSS_SHA512_MGF1, certificate.getSignatureAlgorithm()); } }