JSS Certificate API

From Dogtag
Revision as of 03:26, 6 June 2018 by Edewata (talk | contribs) (Importing CA certificate)

Jump to: navigation, search

Finders

cm.findCertByNickname();
cm.findCertsByNickname();
cm.getCACerts();
cm.getPermCerts();

Importing CA certificate

To import a chain of CA certificates (none of which is a user certificate):

CryptoManager manager = CryptoManager.getInstance();
manager.importCACertPackage(bytes);

The nicknames will be automatically generated based on the Subject DN.

Importing user CA certificate

To import a chain of CA certificates where the leaf certificate is also a user certificate:

CryptoManager manager = CryptoManager.getInstance();
manager.importUserCACertPackage(bytes, nickname);

Importing user certificate

To import a chain of certificates where the leaf certificate is a user certificate:

CryptoManager manager = CryptoManager.getInstance();
manager.importCertPackage(bytes, nickname);

Importing SSL certificate into NSS database

To import SSL certificate into NSS database:

public class Main implements SSLCertificateApprovalCallback {

    public boolean approve(X509Certificate cert, ValidityStatus status) {

        CryptoManager cm = CryptoManager.getInstance();
        cm.importCertToPerm(cert, nickname);
    }
}

References