Class NSSDatabase
java.lang.Object
org.dogtagpki.nss.NSSDatabase
- Author:
- Endi S. Dewata
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNSSDatabase(File directory) NSSDatabase(String directory) NSSDatabase(Path path) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAIAExtension(List<String> cmd, PrintWriter stdin, org.mozilla.jss.netscape.security.extensions.AuthInfoAccessExtension extension) This method provides the arguments and the standard input for certutil to create a cert/CSR with AIA extension.voidaddAKIDExtension(List<String> cmd, PrintWriter stdin, org.mozilla.jss.netscape.security.x509.AuthorityKeyIdentifierExtension extension) This method provides the arguments and the standard input for certutil to create a cert/CSR with AKID extension.voidaddBasicConstraintsExtension(List<String> cmd, PrintWriter stdin, org.mozilla.jss.netscape.security.x509.BasicConstraintsExtension extension) This method provides the arguments and the standard input for certutil to create a cert/CSR with basic constraints extension.org.mozilla.jss.crypto.X509CertificateaddCertificate(String tokenName, String nickname, org.mozilla.jss.netscape.security.x509.X509CertImpl certImpl, String trustFlags) org.mozilla.jss.crypto.X509CertificateaddCertificate(String nickname, org.mozilla.jss.netscape.security.x509.X509CertImpl certImpl, String trustFlags) org.mozilla.jss.crypto.X509CertificateaddCertificate(X509Certificate cert, String trustFlags) voidaddCertificatePoliciesExtension(List<String> cmd, PrintWriter stdin, org.mozilla.jss.netscape.security.x509.CertificatePoliciesExtension extension) This method provides the arguments and the standard input for certutil to create a cert/CSR with certificate policies extension.voidaddExtendedKeyUsageExtension(List<String> cmd, org.mozilla.jss.netscape.security.extensions.ExtendedKeyUsageExtension extension) This method provides the arguments for certutil to create a cert/CSR with extended key usage extension.voidaddExtensions(List<String> cmd, StringWriter sw, org.mozilla.jss.netscape.security.x509.Extensions extensions, Path tmpDir) voidaddKeyUsageExtension(List<String> cmd, org.mozilla.jss.netscape.security.x509.KeyUsageExtension extension) This method provides the arguments for certutil to create a cert/CSR with key usage extension.voidvoidaddOCSPNoCheckExtension(List<String> cmd, PrintWriter stdin, org.mozilla.jss.netscape.security.extensions.OCSPNoCheckExtension extension, Path tmpDir) This method provides the arguments and the standard input for certutil to create a cert/CSR with OCSP No Check extension.org.mozilla.jss.crypto.X509CertificateaddPEMCertificate(String filename, String trustFlags) voidaddPEMCertificate(String nickname, String filename, String trustFlags) voidaddPEMCertificate(String tokenName, String nickname, String filename, String trustFlags) voidaddSKIDExtension(List<String> cmd, PrintWriter stdin, org.mozilla.jss.netscape.security.x509.SubjectKeyIdentifierExtension extension) This method provides the arguments and the standard input for certutil to create a cert/CSR with SKID extension.voidcreate()voidvoidcreateCertificate(String tokenName, org.mozilla.jss.netscape.security.x509.X509Key x509Key, org.mozilla.jss.netscape.security.x509.X500Name subjectName, org.mozilla.jss.crypto.X509Certificate issuer, String serialNumber, int validityLength, int validityUnit, String hash, org.mozilla.jss.netscape.security.x509.Extensions extensions) createCertificate(org.mozilla.jss.netscape.security.x509.X509Key x509Key, org.mozilla.jss.netscape.security.x509.X500Name subjectName, org.mozilla.jss.crypto.X509Certificate issuer, int validityLength, int validityUnit, String hash, org.mozilla.jss.netscape.security.x509.Extensions extensions) createCertificate(org.mozilla.jss.netscape.security.x509.X509Key x509Key, org.mozilla.jss.netscape.security.x509.X500Name subjectName, org.mozilla.jss.crypto.X509Certificate issuer, String serialNumber, int validityLength, int validityUnit, String hash, org.mozilla.jss.netscape.security.x509.Extensions extensions) org.mozilla.jss.asn1.SEQUENCEcreateCRMFRequest(org.mozilla.jss.crypto.CryptoToken token, KeyPair keyPair, org.mozilla.jss.pkix.primitive.Name subject, org.mozilla.jss.crypto.X509Certificate transportCert, org.mozilla.jss.crypto.SignatureAlgorithm signatureAlgorithm, Boolean withPop, org.mozilla.jss.crypto.KeyWrapAlgorithm keyWrapAlgorithm, boolean useOAEP, org.mozilla.jss.netscape.security.x509.Extensions extensions) createECKeyPair(org.mozilla.jss.crypto.CryptoToken token, String curveName, boolean sslECDH) createECKeyPair(org.mozilla.jss.crypto.CryptoToken token, String curveName, boolean sslECDH, Boolean temporary, Boolean sensitive, Boolean extractable) createECKeyPair(org.mozilla.jss.crypto.CryptoToken token, String curveName, Boolean temporary, Boolean sensitive, Boolean extractable, org.mozilla.jss.crypto.KeyPairGeneratorSpi.Usage[] usages, org.mozilla.jss.crypto.KeyPairGeneratorSpi.Usage[] usagesMask) createMLDSAKeyPair(org.mozilla.jss.crypto.CryptoToken token, int keySize, Boolean temporary, Boolean sensitive, Boolean extractable) createMLDSAKeyPair(org.mozilla.jss.crypto.CryptoToken token, int keySize, Boolean temporary, Boolean sensitive, Boolean extractable, org.mozilla.jss.crypto.KeyPairGeneratorSpi.Usage[] usages, org.mozilla.jss.crypto.KeyPairGeneratorSpi.Usage[] usagesMask) org.mozilla.jss.netscape.security.pkcs.PKCS10createPKCS10Request(KeyPair keyPair, String subject, boolean encodingEnabled, String hash, org.mozilla.jss.netscape.security.x509.Extensions extensions) createRSAKeyPair(org.mozilla.jss.crypto.CryptoToken token, int keySize, boolean keyWrap) createRSAKeyPair(org.mozilla.jss.crypto.CryptoToken token, int keySize, boolean keyWrap, Boolean temporary, Boolean sensitive, Boolean extractable) createRSAKeyPair(org.mozilla.jss.crypto.CryptoToken token, int keySize, Boolean temporary, Boolean sensitive, Boolean extractable, org.mozilla.jss.crypto.KeyPairGeneratorSpi.Usage[] usages, org.mozilla.jss.crypto.KeyPairGeneratorSpi.Usage[] usagesMask) org.mozilla.jss.crypto.SymmetricKeycreateSymmetricKey(org.mozilla.jss.crypto.CryptoToken token, org.mozilla.jss.crypto.KeyGenAlgorithm algorithm, int keySize, org.mozilla.jss.crypto.SymmetricKey.Usage[] usages, boolean temporary, Boolean sensitive) voiddebug(Collection<String> command) voiddelete()voiddeleteCertificate(String tokenName, org.mozilla.jss.crypto.X509Certificate cert) booleanexists()org.mozilla.jss.crypto.X509CertificategetCertificate(String nickname) getPath()loadKeyPair(org.mozilla.jss.crypto.CryptoToken token, byte[] keyID) booleanmoduleExists(String name) voidreadStderr(Process process) voidreadStdout(Process process) voidsetDirectory(File directory) voidsetPasswordStore(PasswordStore passwordStore) voidstatic intvalidityUnitFromString(String validityUnit) static StringvalidityUnitToString(int validityUnit) voidwriteStdin(Process process, String input)
-
Field Details
-
logger
public static org.slf4j.Logger logger
-
-
Constructor Details
-
NSSDatabase
public NSSDatabase() -
NSSDatabase
-
NSSDatabase
-
NSSDatabase
-
-
Method Details
-
getPath
-
setPath
-
getDirectory
-
setDirectory
-
getPasswordStore
-
setPasswordStore
-
exists
public boolean exists() -
create
-
create
-
create
-
moduleExists
-
addModule
-
getCertificate
-
addCertificate
public org.mozilla.jss.crypto.X509Certificate addCertificate(X509Certificate cert, String trustFlags) throws Exception - Throws:
Exception
-
addPEMCertificate
-
addCertificate
-
addCertificate
-
addPEMCertificate
-
addPEMCertificate
-
addBasicConstraintsExtension
public void addBasicConstraintsExtension(List<String> cmd, PrintWriter stdin, org.mozilla.jss.netscape.security.x509.BasicConstraintsExtension extension) throws Exception This method provides the arguments and the standard input for certutil to create a cert/CSR with basic constraints extension.- Parameters:
cmd- certutil command and argumentsstdin- certutil's standard inputextension- The extension to add- Throws:
Exception
-
addAKIDExtension
public void addAKIDExtension(List<String> cmd, PrintWriter stdin, org.mozilla.jss.netscape.security.x509.AuthorityKeyIdentifierExtension extension) throws Exception This method provides the arguments and the standard input for certutil to create a cert/CSR with AKID extension.- Parameters:
cmd- certutil command and argumentsstdin- certutil's standard inputextension- The extension to add- Throws:
Exception
-
addSKIDExtension
public void addSKIDExtension(List<String> cmd, PrintWriter stdin, org.mozilla.jss.netscape.security.x509.SubjectKeyIdentifierExtension extension) throws Exception This method provides the arguments and the standard input for certutil to create a cert/CSR with SKID extension.- Parameters:
cmd- certutil command and argumentsstdin- certutil's standard inputextension- The extension to add- Throws:
Exception
-
addAIAExtension
public void addAIAExtension(List<String> cmd, PrintWriter stdin, org.mozilla.jss.netscape.security.extensions.AuthInfoAccessExtension extension) throws Exception This method provides the arguments and the standard input for certutil to create a cert/CSR with AIA extension.- Parameters:
cmd- certutil command and argumentsstdin- certutil's standard inputextension- The extension to add- Throws:
Exception
-
addKeyUsageExtension
public void addKeyUsageExtension(List<String> cmd, org.mozilla.jss.netscape.security.x509.KeyUsageExtension extension) throws Exception This method provides the arguments for certutil to create a cert/CSR with key usage extension.- Parameters:
cmd- certutil command and argumentsextension- The extension to add- Throws:
Exception
-
addExtendedKeyUsageExtension
public void addExtendedKeyUsageExtension(List<String> cmd, org.mozilla.jss.netscape.security.extensions.ExtendedKeyUsageExtension extension) throws Exception This method provides the arguments for certutil to create a cert/CSR with extended key usage extension.- Parameters:
cmd- certutil command and argumentsextension- The extension to add- Throws:
Exception
-
addCertificatePoliciesExtension
public void addCertificatePoliciesExtension(List<String> cmd, PrintWriter stdin, org.mozilla.jss.netscape.security.x509.CertificatePoliciesExtension extension) throws Exception This method provides the arguments and the standard input for certutil to create a cert/CSR with certificate policies extension.- Parameters:
cmd- certutil command and argumentsstdin- certutil's standard inputextension- The extension to add- Throws:
Exception
-
addOCSPNoCheckExtension
public void addOCSPNoCheckExtension(List<String> cmd, PrintWriter stdin, org.mozilla.jss.netscape.security.extensions.OCSPNoCheckExtension extension, Path tmpDir) throws Exception This method provides the arguments and the standard input for certutil to create a cert/CSR with OCSP No Check extension.- Parameters:
cmd- certutil command and argumentsstdin- certutil's standard inputextension- The extension to addtmpDir- Temporary directory to store extension value- Throws:
Exception
-
addExtensions
-
loadKeyPair
-
createRSAKeyPair
public KeyPair createRSAKeyPair(org.mozilla.jss.crypto.CryptoToken token, int keySize, Boolean temporary, Boolean sensitive, Boolean extractable, org.mozilla.jss.crypto.KeyPairGeneratorSpi.Usage[] usages, org.mozilla.jss.crypto.KeyPairGeneratorSpi.Usage[] usagesMask) throws Exception - Throws:
Exception
-
createRSAKeyPair
-
createRSAKeyPair
-
createMLDSAKeyPair
-
createMLDSAKeyPair
public KeyPair createMLDSAKeyPair(org.mozilla.jss.crypto.CryptoToken token, int keySize, Boolean temporary, Boolean sensitive, Boolean extractable, org.mozilla.jss.crypto.KeyPairGeneratorSpi.Usage[] usages, org.mozilla.jss.crypto.KeyPairGeneratorSpi.Usage[] usagesMask) throws Exception - Throws:
Exception
-
createECKeyPair
public KeyPair createECKeyPair(org.mozilla.jss.crypto.CryptoToken token, String curveName, Boolean temporary, Boolean sensitive, Boolean extractable, org.mozilla.jss.crypto.KeyPairGeneratorSpi.Usage[] usages, org.mozilla.jss.crypto.KeyPairGeneratorSpi.Usage[] usagesMask) throws Exception - Throws:
Exception
-
createECKeyPair
-
createECKeyPair
-
createSymmetricKey
-
createPKCS10Request
-
createCRMFRequest
public org.mozilla.jss.asn1.SEQUENCE createCRMFRequest(org.mozilla.jss.crypto.CryptoToken token, KeyPair keyPair, org.mozilla.jss.pkix.primitive.Name subject, org.mozilla.jss.crypto.X509Certificate transportCert, org.mozilla.jss.crypto.SignatureAlgorithm signatureAlgorithm, Boolean withPop, org.mozilla.jss.crypto.KeyWrapAlgorithm keyWrapAlgorithm, boolean useOAEP, org.mozilla.jss.netscape.security.x509.Extensions extensions) throws Exception - Throws:
Exception
-
validityUnitFromString
-
validityUnitToString
-
createCertificate
public X509Certificate createCertificate(org.mozilla.jss.netscape.security.x509.X509Key x509Key, org.mozilla.jss.netscape.security.x509.X500Name subjectName, org.mozilla.jss.crypto.X509Certificate issuer, int validityLength, int validityUnit, String hash, org.mozilla.jss.netscape.security.x509.Extensions extensions) throws Exception - Throws:
Exception
-
createCertificate
public X509Certificate createCertificate(org.mozilla.jss.netscape.security.x509.X509Key x509Key, org.mozilla.jss.netscape.security.x509.X500Name subjectName, org.mozilla.jss.crypto.X509Certificate issuer, String serialNumber, int validityLength, int validityUnit, String hash, org.mozilla.jss.netscape.security.x509.Extensions extensions) throws Exception - Throws:
Exception
-
createCertificate
public X509Certificate createCertificate(String tokenName, org.mozilla.jss.netscape.security.x509.X509Key x509Key, org.mozilla.jss.netscape.security.x509.X500Name subjectName, org.mozilla.jss.crypto.X509Certificate issuer, String serialNumber, int validityLength, int validityUnit, String hash, org.mozilla.jss.netscape.security.x509.Extensions extensions) throws Exception - Throws:
Exception
-
deleteCertificate
-
delete
-
debug
-
readStdout
-
readStderr
-
writeStdin
-