Bouncy Castle Cryptography Library 1.87

org.bouncycastle.cert
Class RelatedCertificateDescriptorBuilder

java.lang.Object
  extended byorg.bouncycastle.cert.RelatedCertificateDescriptorBuilder

public class RelatedCertificateDescriptorBuilder
extends java.lang.Object

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:
RelatedCertificateDescriptor.fromExtensions(org.bouncycastle.asn1.x509.Extensions)

Constructor Summary
RelatedCertificateDescriptorBuilder()
           
 
Method Summary
 org.bouncycastle.asn1.x509.RelatedCertificateDescriptor build()
          Build the bare descriptor.
 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 GeneralName whose type-id is BCObjectIdentifiers.id_on_relatedCertificateDescriptor and whose value is the descriptor built from the current builder state.
 RelatedCertificateDescriptorBuilder setCertHash(org.bouncycastle.asn1.x509.RelatedCertificate certHash)
          Set the optional RFC 9763 hash of the Referenced Certificate.
 RelatedCertificateDescriptorBuilder setMethod(org.bouncycastle.asn1.x509.CertDiscoveryMethod method)
           
 RelatedCertificateDescriptorBuilder setMethodByInclusion(org.bouncycastle.asn1.x509.Certificate certificate)
          Convenience for .
 RelatedCertificateDescriptorBuilder setMethodByInclusion(X509CertificateHolder certificate)
          Convenience for .
 RelatedCertificateDescriptorBuilder setMethodByLocalPolicy()
          Convenience for .
 RelatedCertificateDescriptorBuilder setMethodByOther(org.bouncycastle.asn1.ASN1ObjectIdentifier methodType, org.bouncycastle.asn1.ASN1Encodable methodValue)
          Convenience for .
 RelatedCertificateDescriptorBuilder setMethodByUri(java.lang.String uri)
          Convenience for .
 RelatedCertificateDescriptorBuilder setPublicKeyAlgorithm(org.bouncycastle.asn1.x509.AlgorithmIdentifier publicKeyAlgorithm)
           
 RelatedCertificateDescriptorBuilder setSignatureAlgorithm(org.bouncycastle.asn1.x509.AlgorithmIdentifier signatureAlgorithm)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelatedCertificateDescriptorBuilder

public RelatedCertificateDescriptorBuilder()
Method Detail

setMethod

public RelatedCertificateDescriptorBuilder setMethod(org.bouncycastle.asn1.x509.CertDiscoveryMethod method)

setMethodByUri

public RelatedCertificateDescriptorBuilder setMethodByUri(java.lang.String uri)
Convenience for .


setMethodByInclusion

public RelatedCertificateDescriptorBuilder setMethodByInclusion(X509CertificateHolder certificate)
Convenience for .


setMethodByInclusion

public RelatedCertificateDescriptorBuilder setMethodByInclusion(org.bouncycastle.asn1.x509.Certificate certificate)
Convenience for .


setMethodByLocalPolicy

public RelatedCertificateDescriptorBuilder setMethodByLocalPolicy()
Convenience for .


setMethodByOther

public RelatedCertificateDescriptorBuilder setMethodByOther(org.bouncycastle.asn1.ASN1ObjectIdentifier methodType,
                                                            org.bouncycastle.asn1.ASN1Encodable methodValue)
Convenience for .


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 an AccessDescription suitable for adding to a SubjectInfoAccess extension: accessMethod is BCObjectIdentifiers.id_ad_certDiscovery, accessLocation is an GeneralName whose type-id is BCObjectIdentifiers.id_on_relatedCertificateDescriptor and whose value is the descriptor built from the current builder state.


Bouncy Castle Cryptography Library 1.87