Home / Class/ CertificateList Class — netty Architecture

CertificateList Class — netty Architecture

Architecture documentation for the CertificateList class in CertificateList.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  53ca3456_3d8d_90c9_5fef_2a0efeb7b928["CertificateList"]
  6c2ab2b8_591d_0fe2_ea95_8449307bfaab["CertificateList.java"]
  53ca3456_3d8d_90c9_5fef_2a0efeb7b928 -->|defined in| 6c2ab2b8_591d_0fe2_ea95_8449307bfaab
  25fc7e3d_4356_71a7_c412_ddfc6c8e5e9f["CertificateList()"]
  53ca3456_3d8d_90c9_5fef_2a0efeb7b928 -->|method| 25fc7e3d_4356_71a7_c412_ddfc6c8e5e9f
  2b7a6303_cf47_81ef_840c_4f6331c78b08["getEncoded()"]
  53ca3456_3d8d_90c9_5fef_2a0efeb7b928 -->|method| 2b7a6303_cf47_81ef_840c_4f6331c78b08

Relationship Graph

Source Code

pkitesting/src/main/java/io/netty/pkitesting/CertificateList.java lines 36–75

final class CertificateList {
    private final X509Bundle issuer;
    private final Instant thisUpdate;
    private final Instant nextUpdate;
    private final Iterable<Map.Entry<BigInteger, Instant>> revokedCerts;

    CertificateList(X509Bundle issuer, Instant thisUpdate, Instant nextUpdate,
                    Iterable<Map.Entry<BigInteger, Instant>> revokedCerts) {
        this.issuer = issuer;
        this.thisUpdate = thisUpdate;
        this.nextUpdate = nextUpdate;
        this.revokedCerts = revokedCerts;
    }

    byte[] getEncoded() {
        ASN1EncodableVector vec = new ASN1EncodableVector();
        X509Certificate cert = issuer.getCertificate();
        vec.add(new ASN1Integer(1)); // Version 2
        vec.add(new AlgorithmIdentifier(new ASN1ObjectIdentifier(cert.getSigAlgOID())));
        vec.add(X500Name.getInstance(cert.getSubjectX500Principal().getEncoded()));
        vec.add(new Time(Date.from(thisUpdate)));
        if (nextUpdate != null) {
            vec.add(new Time(Date.from(nextUpdate)));
        }
        ASN1EncodableVector revokedVec = new ASN1EncodableVector();
        for (Map.Entry<BigInteger, Instant> revokedCert : revokedCerts) {
            revokedVec.add(TBSCertList.CRLEntry.getInstance(new DERSequence(new ASN1Encodable[]{
                    new ASN1Integer(revokedCert.getKey()),
                    new Time(Date.from(revokedCert.getValue()))
            })));
        }
        vec.add(new DERSequence(revokedVec));
        TBSCertList list = new TBSCertList(new DERSequence(vec));
        try {
            return list.getEncoded("DER");
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }
}

Frequently Asked Questions

What is the CertificateList class?
CertificateList is a class in the netty codebase, defined in pkitesting/src/main/java/io/netty/pkitesting/CertificateList.java.
Where is CertificateList defined?
CertificateList is defined in pkitesting/src/main/java/io/netty/pkitesting/CertificateList.java at line 36.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free