Search in sources :

Example 6 with GenerateCertRequest

use of de.carne.certmgr.certs.x509.GenerateCertRequest in project certmgr by hdecarne.

the class UserCertStoreTest method basicRequest.

private GenerateCertRequest basicRequest() {
    KeyPairAlgorithm keyPairAlgorithm = Check.notNull(KeyPairAlgorithm.getDefaultSet(null, false).getDefault());
    GenerateCertRequest request = new GenerateCertRequest(X500Names.fromString("CN=TestCert"), keyPairAlgorithm, Check.notNull(keyPairAlgorithm.getStandardKeySizes(null).getDefault()));
    Date notBefore = new Date();
    Date notAfter = new Date(notBefore.getTime() + 1000 * 60 * 24);
    request.setNotBefore(notBefore);
    request.setNotAfter(notAfter);
    return request;
}
Also used : KeyPairAlgorithm(de.carne.certmgr.certs.security.KeyPairAlgorithm) GenerateCertRequest(de.carne.certmgr.certs.x509.GenerateCertRequest) Date(java.util.Date)

Aggregations

GenerateCertRequest (de.carne.certmgr.certs.x509.GenerateCertRequest)5 KeyPairAlgorithm (de.carne.certmgr.certs.security.KeyPairAlgorithm)2 Date (java.util.Date)2 CertObjectStore (de.carne.certmgr.certs.CertObjectStore)1 UserCertStore (de.carne.certmgr.certs.UserCertStore)1 UserCertStoreEntry (de.carne.certmgr.certs.UserCertStoreEntry)1 SignatureAlgorithm (de.carne.certmgr.certs.security.SignatureAlgorithm)1 CertGenerator (de.carne.certmgr.certs.spi.CertGenerator)1 BasicConstraintsExtensionData (de.carne.certmgr.certs.x509.BasicConstraintsExtensionData)1 PKCS10CertificateRequest (de.carne.certmgr.certs.x509.PKCS10CertificateRequest)1 Issuer (de.carne.certmgr.certs.x509.generator.Issuer)1 ValidationException (de.carne.jfx.util.validation.ValidationException)1 IOException (java.io.IOException)1 FileAlreadyExistsException (java.nio.file.FileAlreadyExistsException)1 Path (java.nio.file.Path)1 KeyPair (java.security.KeyPair)1 LocalDate (java.time.LocalDate)1 FXML (javafx.fxml.FXML)1 X500Principal (javax.security.auth.x500.X500Principal)1 Test (org.junit.Test)1