Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 683 Bytes

README.md

File metadata and controls

23 lines (17 loc) · 683 Bytes

Java library for generating X509 Verifiable credentials

Usage

try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream("full-chain-and-leaf.pem")) {
    List<X509Certificate> certificates = X509CertificateParser.parse(inputStream);
    Certificate certificate = new Certificate(certificates);
    String jwt = JWTGenerator.generateVC(certificate, privateKey, "did:web:example.com:iam:the_subject");
}

Caveats

Use the BouncyCastle provider when parsing PKCS12 files and extracting certificates for it:

static {
    Security.addProvider(new BouncyCastleProvider());
}

KeyStore keystore = KeyStore.getInstance("PKCS12", "BC");