Package org.bouncycastle.cert

Examples of org.bouncycastle.cert.X509v3CertificateBuilder


      Date notBefore = new Date(System.currentTimeMillis() - ONEDAY);
      Date notAfter = new Date(System.currentTimeMillis() + 10 * ONEYEAR);
      BigInteger serial = BigInteger.valueOf(System.currentTimeMillis());

      X509v3CertificateBuilder certGen = new JcaX509v3CertificateBuilder(builder.build(),
          serial, notBefore, notAfter, builder.build(), pair.getPublic());
      ContentSigner sigGen = new JcaContentSignerBuilder("SHA256WithRSAEncryption")
          .setProvider(BC).build(pair.getPrivate());
      X509Certificate cert = new JcaX509CertificateConverter().setProvider(BC)
          .getCertificate(certGen.build(sigGen));
      cert.checkValidity(new Date());
      cert.verify(cert.getPublicKey());

      // Save to keystore
      KeyStore store = KeyStore.getInstance("JKS");
View Full Code Here


      Date notBefore = new Date(System.currentTimeMillis() - ONEDAY);
      Date notAfter = new Date(System.currentTimeMillis() + 10 * ONEYEAR);
      BigInteger serial = BigInteger.valueOf(System.currentTimeMillis());

      X509v3CertificateBuilder certGen = new JcaX509v3CertificateBuilder(principal, serial,
          notBefore, notAfter, principal, pair.getPublic());
      ContentSigner sigGen = new JcaContentSignerBuilder("SHA256WithRSAEncryption")
          .setProvider(BC).build(pair.getPrivate());
      X509Certificate cert = new JcaX509CertificateConverter().setProvider(BC)
          .getCertificate(certGen.build(sigGen));
      cert.checkValidity(new Date());
      cert.verify(cert.getPublicKey());

      // Save to keystore
      KeyStore store = KeyStore.getInstance("JKS");
View Full Code Here

TOP

Related Classes of org.bouncycastle.cert.X509v3CertificateBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.