org.spongycastle.asn1.x509.V3TBSCertificateGenerator.setSignature()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(162)

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

V3TBSCertificateGenerator.setSignature介绍

暂无

代码示例

代码示例来源:origin: com.madgag.spongycastle/prov

/**
 * Set the signature algorithm. This can be either a name or an OID, names
 * are treated as case insensitive.
 * 
 * @param signatureAlgorithm string representation of the algorithm name.
 */
public void setSignatureAlgorithm(
  String  signatureAlgorithm)
{
  this.signatureAlgorithm = signatureAlgorithm;
  try
  {
    sigOID = X509Util.getAlgorithmOID(signatureAlgorithm);
  }
  catch (Exception e)
  {
    throw new IllegalArgumentException("Unknown signature type requested: " + signatureAlgorithm);
  }
  sigAlgId = X509Util.getSigAlgID(sigOID, signatureAlgorithm);
  tbsGen.setSignature(sigAlgId);
}

代码示例来源:origin: com.madgag/scprov-jdk15on

/**
 * Set the signature algorithm. This can be either a name or an OID, names
 * are treated as case insensitive.
 * 
 * @param signatureAlgorithm string representation of the algorithm name.
 */
public void setSignatureAlgorithm(
  String  signatureAlgorithm)
{
  this.signatureAlgorithm = signatureAlgorithm;
  try
  {
    sigOID = X509Util.getAlgorithmOID(signatureAlgorithm);
  }
  catch (Exception e)
  {
    throw new IllegalArgumentException("Unknown signature type requested: " + signatureAlgorithm);
  }
  sigAlgId = X509Util.getSigAlgID(sigOID, signatureAlgorithm);
  tbsGen.setSignature(sigAlgId);
}

代码示例来源:origin: com.madgag.spongycastle/pkix

/**
   * Generate an X.509 certificate, based on the current issuer and subject
   * using the passed in signer.
   *
   * @param signer the content signer to be used to generate the signature validating the certificate.
   * @return a holder containing the resulting signed certificate.
   */
  public X509CertificateHolder build(
    ContentSigner signer)
  {
    tbsGen.setSignature(signer.getAlgorithmIdentifier());

    if (!extGenerator.isEmpty())
    {
      tbsGen.setExtensions(extGenerator.generate());
    }

    return CertUtils.generateFullCert(signer, tbsGen.generateTBSCertificate());
  }
}

代码示例来源:origin: stackoverflow.com

tbsGen.setSubject(new X500Name(dn));
tbsGen.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(certPubKey.getEncoded()));
tbsGen.setSignature(sigGen.getAlgorithmIdentifier());

代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on

/**
   * Generate an X.509 certificate, based on the current issuer and subject
   * using the passed in signer.
   *
   * @param signer the content signer to be used to generate the signature validating the certificate.
   * @return a holder containing the resulting signed certificate.
   */
  public X509CertificateHolder build(
    ContentSigner signer)
  {
    tbsGen.setSignature(signer.getAlgorithmIdentifier());

    if (!extGenerator.isEmpty())
    {
      tbsGen.setExtensions(extGenerator.generate());
    }

    return CertUtils.generateFullCert(signer, tbsGen.generateTBSCertificate());
  }
}

相关文章