org.bouncycastle.its.bc.BcITSExplicitCertificateBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of polaris-all Show documentation
Show all versions of polaris-all Show documentation
All in one project for polaris-java
package org.bouncycastle.its.bc;
import org.bouncycastle.crypto.params.ECPublicKeyParameters;
import org.bouncycastle.its.ITSCertificate;
import org.bouncycastle.its.ITSExplicitCertificateBuilder;
import org.bouncycastle.its.ITSPublicEncryptionKey;
import org.bouncycastle.its.operator.ITSContentSigner;
import org.bouncycastle.oer.its.ieee1609dot2.CertificateId;
import org.bouncycastle.oer.its.ieee1609dot2.ToBeSignedCertificate;
public class BcITSExplicitCertificateBuilder
extends ITSExplicitCertificateBuilder
{
/**
* Base constructor for an ITS certificate.
*
* @param signer the content signer to be used to generate the signature validating the certificate.
* @param tbsCertificate
*/
public BcITSExplicitCertificateBuilder(ITSContentSigner signer, ToBeSignedCertificate.Builder tbsCertificate)
{
super(signer, tbsCertificate);
}
public ITSCertificate build(
CertificateId certificateId,
ECPublicKeyParameters verificationKey)
{
return build(certificateId, verificationKey, null);
}
public ITSCertificate build(
CertificateId certificateId,
ECPublicKeyParameters verificationKey,
ECPublicKeyParameters encryptionKey)
{
ITSPublicEncryptionKey publicEncryptionKey = null;
if (encryptionKey != null)
{
publicEncryptionKey = new BcITSPublicEncryptionKey(encryptionKey);
}
return super.build(certificateId, new BcITSPublicVerificationKey(verificationKey), publicEncryptionKey);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy