Class RelatedCertificateDescriptorBuilder


  • public class RelatedCertificateDescriptorBuilder
    extends java.lang.Object
    Fluent builder for the RelatedCertificateDescriptor structure defined by draft-ietf-lamps-certdiscovery, plus the wrapping required to place it in a SubjectInfoAccess extension.

    Typical use, adding a "fetch the agility companion over HTTP" entry to a certificate's SubjectInfoAccess extension:

         AccessDescription ad = new RelatedCertificateDescriptorBuilder()
             .setMethodByUri("https://example.com/companion.cer")
             .setIntent(BCObjectIdentifiers.id_rcd_agility)
             .setSignatureAlgorithm(sigAlg)
             .setPublicKeyAlgorithm(spkiAlg)
             .buildAccessDescription();
         // ad goes into a SEQUENCE OF AccessDescription added as the
         // SubjectInfoAccess extension on an X509v3CertificateBuilder.
     
    See Also:
    RelatedCertificateDescriptor.fromExtensions(org.bouncycastle.asn1.x509.Extensions)
    • Constructor Detail

      • RelatedCertificateDescriptorBuilder

        public RelatedCertificateDescriptorBuilder()
    • Method Detail

      • setMethodByInclusion

        public RelatedCertificateDescriptorBuilder setMethodByInclusion​(org.bouncycastle.asn1.x509.Certificate certificate)
        Convenience for setMethod(CertDiscoveryMethod.byInclusion(cert)).
      • setIntent

        public RelatedCertificateDescriptorBuilder setIntent​(org.bouncycastle.asn1.ASN1ObjectIdentifier intent)
        Set the optional DiscoveryIntentId (an OID under BCObjectIdentifiers.id_rcd: agility, redundancy, dual, privKeyStmt or self).
      • build

        public org.bouncycastle.asn1.x509.RelatedCertificateDescriptor build()
        Build the bare descriptor.
      • buildAccessDescription

        public org.bouncycastle.asn1.x509.AccessDescription buildAccessDescription()
        Build an AccessDescription suitable for adding to a SubjectInfoAccess extension: accessMethod is BCObjectIdentifiers.id_ad_certDiscovery, accessLocation is an otherName GeneralName whose type-id is BCObjectIdentifiers.id_on_relatedCertificateDescriptor and whose value is the descriptor built from the current builder state.