Skip to content

CryptoManager

Endi S. Dewata edited this page Jul 29, 2022 · 1 revision

Initialization

CryptoManager.initialize(nssDatabasePath);

CryptoManager cm = CryptoManager.getInstance();

Certificates

To import CA cert chain:

X509Certificate leafCert = cm.importCACertPackage(chain);

To import user cert chain:

X509Certificate leafCert = cm.importCertPackage(chain, nickname);

To import CA and user cert chain:

X509Certificate leafCert = cm.importUserCACertPackage(chain, nickname);

Keys

To find a private key associated with a cert:

PrivateKey privateKey = cm.findPrivKeyByCert(cert);