Class RelatedCertificateDescriptorBuilder
java.lang.Object
org.bouncycastle.cert.RelatedCertificateDescriptorBuilder
Fluent builder for the
RelatedCertificateDescriptor structure
defined by draft-ietf-lamps-certdiscovery-04, plus the wrapping required to
place it in a SubjectInfoAccess extension.
Typical use, adding a "fetch the companion certificate over HTTP" entry to a certificate's SubjectInfoAccess extension:
AccessDescription ad = new RelatedCertificateDescriptorBuilder()
.setMethodByUri("https://example.com/companion.cer")
.setSignatureAlgorithm(sigAlg)
.setPublicKeyAlgorithm(spkiAlg)
.setCertHash(new RelatedCertificate(digAlg, new DEROctetString(hash)))
.buildAccessDescription();
// ad goes into a SEQUENCE OF AccessDescription added as the
// SubjectInfoAccess extension on an X509v3CertificateBuilder.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.asn1.x509.RelatedCertificateDescriptorbuild()Build the bare descriptor.org.bouncycastle.asn1.x509.AccessDescriptionBuild anAccessDescriptionsuitable for adding to a SubjectInfoAccess extension: accessMethod isBCObjectIdentifiers.id_ad_certDiscovery, accessLocation is anotherNameGeneralName whose type-id isBCObjectIdentifiers.id_on_relatedCertificateDescriptorand whose value is the descriptor built from the current builder state.setCertHash(org.bouncycastle.asn1.x509.RelatedCertificate certHash) Set the optional RFC 9763 hash of the Referenced Certificate.setMethod(org.bouncycastle.asn1.x509.CertDiscoveryMethod method) setMethodByInclusion(org.bouncycastle.asn1.x509.Certificate certificate) Convenience forsetMethod(CertDiscoveryMethod.byInclusion(cert)).setMethodByInclusion(X509CertificateHolder certificate) Convenience forsetMethod(CertDiscoveryMethod.byInclusion(cert)).Convenience forsetMethod(CertDiscoveryMethod.byLocalPolicy()).setMethodByOther(org.bouncycastle.asn1.ASN1ObjectIdentifier methodType, org.bouncycastle.asn1.ASN1Encodable methodValue) Convenience forsetMethod(CertDiscoveryMethod.byOther(methodType, methodValue)).setMethodByUri(String uri) Convenience forsetMethod(CertDiscoveryMethod.byUri(uri)).setPublicKeyAlgorithm(org.bouncycastle.asn1.x509.AlgorithmIdentifier publicKeyAlgorithm) setSignatureAlgorithm(org.bouncycastle.asn1.x509.AlgorithmIdentifier signatureAlgorithm)
-
Constructor Details
-
RelatedCertificateDescriptorBuilder
public RelatedCertificateDescriptorBuilder()
-
-
Method Details
-
setMethod
public RelatedCertificateDescriptorBuilder setMethod(org.bouncycastle.asn1.x509.CertDiscoveryMethod method) -
setMethodByUri
Convenience forsetMethod(CertDiscoveryMethod.byUri(uri)). -
setMethodByInclusion
Convenience forsetMethod(CertDiscoveryMethod.byInclusion(cert)). -
setMethodByInclusion
public RelatedCertificateDescriptorBuilder setMethodByInclusion(org.bouncycastle.asn1.x509.Certificate certificate) Convenience forsetMethod(CertDiscoveryMethod.byInclusion(cert)). -
setMethodByLocalPolicy
Convenience forsetMethod(CertDiscoveryMethod.byLocalPolicy()). -
setMethodByOther
public RelatedCertificateDescriptorBuilder setMethodByOther(org.bouncycastle.asn1.ASN1ObjectIdentifier methodType, org.bouncycastle.asn1.ASN1Encodable methodValue) Convenience forsetMethod(CertDiscoveryMethod.byOther(methodType, methodValue)). -
setSignatureAlgorithm
public RelatedCertificateDescriptorBuilder setSignatureAlgorithm(org.bouncycastle.asn1.x509.AlgorithmIdentifier signatureAlgorithm) -
setPublicKeyAlgorithm
public RelatedCertificateDescriptorBuilder setPublicKeyAlgorithm(org.bouncycastle.asn1.x509.AlgorithmIdentifier publicKeyAlgorithm) -
setCertHash
public RelatedCertificateDescriptorBuilder setCertHash(org.bouncycastle.asn1.x509.RelatedCertificate certHash) Set the optional RFC 9763 hash of the Referenced Certificate. -
build
public org.bouncycastle.asn1.x509.RelatedCertificateDescriptor build()Build the bare descriptor. -
buildAccessDescription
public org.bouncycastle.asn1.x509.AccessDescription buildAccessDescription()Build anAccessDescriptionsuitable for adding to a SubjectInfoAccess extension: accessMethod isBCObjectIdentifiers.id_ad_certDiscovery, accessLocation is anotherNameGeneralName whose type-id isBCObjectIdentifiers.id_on_relatedCertificateDescriptorand whose value is the descriptor built from the current builder state.
-