GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add acmeIdentifier extension support to pkitesting (#16256) · netty/netty@15ce813

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • pkitesting/src/main/java/io/netty/pkitesting
    • CertificateBuilder.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎pkitesting/src/main/java/io/netty/pkitesting/CertificateBuilder.java‎

Copy file name to clipboardExpand all lines: pkitesting/src/main/java/io/netty/pkitesting/CertificateBuilder.java
+26Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ public final class CertificateBuilder {
113113
static final String OID_PKIX_KP_EMAIL_PROTECTION = OID_PKIX_KP + ".4";
114114
static final String OID_PKIX_KP_TIME_STAMPING = OID_PKIX_KP + ".8";
115115
static final String OID_PKIX_KP_OCSP_SIGNING = OID_PKIX_KP + ".9";
116+
static final String OID_PKIX_PE_ACME_IDENTIFIER = "1.3.6.1.5.5.7.1.31";
116117
static final String OID_KERBEROS_KEY_PURPOSE_CLIENT_AUTH = "1.3.6.1.5.2.3.4";
117118
static final String OID_MICROSOFT_SMARTCARD_LOGIN = "1.3.6.1.4.1.311.20.2.2";
118119
private static final GeneralName[] EMPTY_GENERAL_NAMES = new GeneralName[0];
@@ -560,6 +561,31 @@ public CertificateBuilder addExtensionAsciiString(String identifierOID, boolean
560561
}
561562
}
562563

564+
/**
565+
* Add an {@code acmeIdentifier} extension marked {@code critical}, with the given authorization SHA-256 value.
566+
* <p>
567+
* The {@code acmeIdentifier} extension is specified by
568+
* <a href="https://datatracker.ietf.org/doc/html/rfc8737">RFC 8737</a>,
569+
* which specify the TLS-ALPN-01 challenge type.
570+
* See the <a href="https://letsencrypt.org/docs/challenge-types/#tls-alpn-01">Let's Encrypt documentation</a>
571+
* for a short summary of this ACME challenge method.
572+
* <p>
573+
* To use this challenge method, the server must accept TLS connections with an ALPN protocol name of
574+
* {@code acme-tls/1} and an SNI extension for the hostname being challenged.
575+
* The server must then offer a self-signed certificate that include both this extension,
576+
* and a {@linkplain #addSanDnsName(String) dNSName SAN} with the hostname that is being challenged.
577+
* <p>
578+
* The extension value must be the SHA-256 of the key authorization challenge.
579+
* See <a href="https://datatracker.ietf.org/doc/html/rfc8555#section-8.1">RFC 8555</a> for details on key
580+
* authorizations.
581+
*
582+
* @param sha256 The SHA-256 of the key authorization.
583+
* @return This certificate builder.
584+
*/
585+
public CertificateBuilder addAcmeIdentifierExtension(byte[] sha256) {
586+
return addExtension(OID_PKIX_PE_ACME_IDENTIFIER, true, requireNonNull(sha256, "sha256"));
587+
}
588+
563589
/**
564590
* The key usage specify the intended usages for which the certificate has been issued.
565591
* Some are overlapping, some are deprecated, and some are implied by usage.

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.