gpt4 book ai didi

org.wildfly.security.x500.cert.X509CertificateBuilder.setVersion()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 20:08:40 26 4
gpt4 key购买 nike

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

X509CertificateBuilder.setVersion介绍

[英]Set the certificate version.
[中]设置证书版本。

代码示例

代码示例来源:origin: wildfly/wildfly

certificateBuilder.setSigningKey(signingKey);
certificateBuilder.setSignatureAlgorithmName(signatureAlgorithmName);
certificateBuilder.setVersion(VERSION);
BigInteger serialNumber = new BigInteger(64, new SecureRandom());
certificateBuilder.setSerialNumber(serialNumber);

代码示例来源:origin: org.wildfly.core/wildfly-domain-management

X509Certificate generateCertificate(KeyPair pair) throws Exception {
  PrivateKey privkey = pair.getPrivate();
  X509CertificateBuilder builder = new X509CertificateBuilder();
  Date from = new Date();
  Date to = new Date(from.getTime() + (1000L * 60L * 60L * 24L * 365L * 10L));
  BigInteger sn = new BigInteger(64, new SecureRandom());
  builder.setNotValidAfter(ZonedDateTime.ofInstant(Instant.ofEpochMilli(to.getTime()), TimeZone.getDefault().toZoneId()));
  builder.setNotValidBefore(ZonedDateTime.ofInstant(Instant.ofEpochMilli(from.getTime()), TimeZone.getDefault().toZoneId()));
  builder.setSerialNumber(sn);
  X500Principal owner = new X500Principal("CN=" + autoGenerateCertHostName);
  builder.setSubjectDn(owner);
  builder.setIssuerDn(owner);
  builder.setPublicKey(pair.getPublic());
  builder.setVersion(3);
  builder.setSignatureAlgorithmName(SHA_256_WITH_RSA);
  builder.setSigningKey(privkey);
  return builder.build();
}

代码示例来源:origin: wildfly/wildfly-core

X509Certificate generateCertificate(KeyPair pair) throws Exception {
  PrivateKey privkey = pair.getPrivate();
  X509CertificateBuilder builder = new X509CertificateBuilder();
  Date from = new Date();
  Date to = new Date(from.getTime() + (1000L * 60L * 60L * 24L * 365L * 10L));
  BigInteger sn = new BigInteger(64, new SecureRandom());
  builder.setNotValidAfter(ZonedDateTime.ofInstant(Instant.ofEpochMilli(to.getTime()), TimeZone.getDefault().toZoneId()));
  builder.setNotValidBefore(ZonedDateTime.ofInstant(Instant.ofEpochMilli(from.getTime()), TimeZone.getDefault().toZoneId()));
  builder.setSerialNumber(sn);
  X500Principal owner = new X500Principal("CN=" + autoGenerateCertHostName);
  builder.setSubjectDn(owner);
  builder.setIssuerDn(owner);
  builder.setPublicKey(pair.getPublic());
  builder.setVersion(3);
  builder.setSignatureAlgorithmName(SHA_256_WITH_RSA);
  builder.setSigningKey(privkey);
  return builder.build();
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

certificateBuilder.setSigningKey(signingKey);
certificateBuilder.setSignatureAlgorithmName(signatureAlgorithmName);
certificateBuilder.setVersion(VERSION);
BigInteger serialNumber = new BigInteger(64, new SecureRandom());
certificateBuilder.setSerialNumber(serialNumber);

代码示例来源:origin: org.wildfly.security/wildfly-elytron

certificateBuilder.setSigningKey(signingKey);
certificateBuilder.setSignatureAlgorithmName(signatureAlgorithmName);
certificateBuilder.setVersion(VERSION);
BigInteger serialNumber = new BigInteger(64, new SecureRandom());
certificateBuilder.setSerialNumber(serialNumber);

代码示例来源:origin: org.wildfly.security/wildfly-elytron-x500-cert

certificateBuilder.setSigningKey(signingKey);
certificateBuilder.setSignatureAlgorithmName(signatureAlgorithmName);
certificateBuilder.setVersion(VERSION);
BigInteger serialNumber = new BigInteger(64, new SecureRandom());
certificateBuilder.setSerialNumber(serialNumber);

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