gpt4 book ai didi

org.bouncycastle.cert.X509v2CRLBuilder.setNextUpdate()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 12:49:05 33 4
gpt4 key购买 nike

本文整理了Java中org.bouncycastle.cert.X509v2CRLBuilder.setNextUpdate()方法的一些代码示例,展示了X509v2CRLBuilder.setNextUpdate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。X509v2CRLBuilder.setNextUpdate()方法的具体详情如下:
包路径:org.bouncycastle.cert.X509v2CRLBuilder
类名称:X509v2CRLBuilder
方法名:setNextUpdate

X509v2CRLBuilder.setNextUpdate介绍

暂无

代码示例

代码示例来源:origin: apache/zookeeper

private void buildCRL(X509Certificate x509Certificate, String crlPath) throws Exception {
  X509v2CRLBuilder builder = new JcaX509v2CRLBuilder(x509Certificate.getIssuerX500Principal(), certStartTime);
  builder.addCRLEntry(x509Certificate.getSerialNumber(), certStartTime, CRLReason.cACompromise);
  builder.setNextUpdate(certEndTime);
  builder.addExtension(Extension.authorityKeyIdentifier, false, new JcaX509ExtensionUtils()
      .createAuthorityKeyIdentifier(rootCertificate));
  builder.addExtension(Extension.cRLNumber, false, new CRLNumber(new BigInteger("1000")));
  X509CRLHolder cRLHolder = builder.build(contentSigner);
  PemWriter pemWriter = new PemWriter(new FileWriter(crlPath));
  pemWriter.writeObject(new MiscPEMGenerator(cRLHolder));
  pemWriter.flush();
  pemWriter.close();
}

代码示例来源:origin: org.opendaylight.snbi/southplugin

public static void createCRL(String name) {
    X500NameBuilder builder = new X500NameBuilder(BCStyle.INSTANCE);
//        builder.addRDN(BCStyle.C, defaults.get("COUNTRY"));
//        builder.addRDN(BCStyle.O, defaults.get("ORGANIZATION"));
    // builder.addRDN(BCStyle.ST, defaults.get("STATE"));
    // builder.addRDN(BCStyle.T, defaults.get("TITLE"));
    builder.addRDN(BCStyle.SN, BigInteger.valueOf(System.currentTimeMillis()).toString());
    builder.addRDN(BCStyle.CN, name);
    Calendar now = Calendar.getInstance();
    Date notBefore = now.getTime();
    now.add(Calendar.YEAR, 3);
    Date notAfter = now.getTime();
    X509v2CRLBuilder crlGen = new X509v2CRLBuilder(builder.build(),notBefore);
    crlGen.setNextUpdate(notAfter);
  }

代码示例来源:origin: org.xipki.scep/scep-server-emulator

public synchronized CertificateList getCrl(X500Name issuer, BigInteger serialNumber)
  throws Exception {
 if (crl != null) {
  return crl;
 }
 Date thisUpdate = new Date();
 X509v2CRLBuilder crlBuilder = new X509v2CRLBuilder(caSubject, thisUpdate);
 Date nextUpdate = new Date(thisUpdate.getTime() + 30 * DAY_IN_MS);
 crlBuilder.setNextUpdate(nextUpdate);
 Date caStartTime = caCert.getTBSCertificate().getStartDate().getDate();
 Date revocationTime = new Date(caStartTime.getTime() + 1);
 if (revocationTime.after(thisUpdate)) {
  revocationTime = caStartTime;
 }
 crlBuilder.addCRLEntry(BigInteger.valueOf(2), revocationTime, CRLReason.keyCompromise);
 crlBuilder.addExtension(Extension.cRLNumber, false, new ASN1Integer(crlNumber.getAndAdd(1)));
 String signatureAlgorithm = ScepUtil.getSignatureAlgorithm(caKey, ScepHashAlgo.SHA256);
 ContentSigner contentSigner = new JcaContentSignerBuilder(signatureAlgorithm).build(caKey);
 X509CRLHolder crl = crlBuilder.build(contentSigner);
 return crl.toASN1Structure();
}

代码示例来源:origin: puppetlabs/certificate-authority

Date nextUpdate = now.plusYears(5).toDate();
X509v2CRLBuilder builder = new JcaX509v2CRLBuilder(issuer, issueDate);
builder.setNextUpdate(nextUpdate);
builder.addExtension(Extension.authorityKeyIdentifier, false,
           new AuthorityKeyIdentifierStructure(issuerPublicKey));

代码示例来源:origin: puppetlabs/ssl-utils

Date nextUpdate = now.plusYears(5).toDate();
X509v2CRLBuilder builder = new JcaX509v2CRLBuilder(issuer, issueDate);
builder.setNextUpdate(nextUpdate);
builder.addExtension(Extension.authorityKeyIdentifier, false,
           new JcaX509ExtensionUtils().createAuthorityKeyIdentifier(issuerPublicKey));

代码示例来源:origin: puppetlabs/certificate-authority

X509v2CRLBuilder builder =
  new JcaX509v2CRLBuilder(crl.getIssuerX500Principal(), thisUpdate);
builder.setNextUpdate(nextUpdate);

代码示例来源:origin: puppetlabs/ssl-utils

X509v2CRLBuilder builder =
  new JcaX509v2CRLBuilder(crl.getIssuerX500Principal(), thisUpdate);
builder.setNextUpdate(nextUpdate);

代码示例来源:origin: org.xipki/ca-server

crlBuilder.setNextUpdate(nextUpdate);

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com