11/*
2- * Copyright 2016-2022 the original author or authors.
2+ * Copyright 2016-2023 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
3636 * provide the verification functionality.
3737 *
3838 * @author Mark Paluch
39+ * @author Nanne Baars
3940 * @see <a href=
4041 * "https://www.vaultproject.io/docs/secrets/pki/index.html">https://www.vaultproject.io/docs/secrets/pki/index.html</a>
4142 */
@@ -66,10 +67,10 @@ VaultCertificateResponse issueCertificate(String roleName, VaultCertificateReque
6667 * @param certificateRequest must not be {@literal null}.
6768 * @return the {@link VaultCertificateResponse} containing a
6869 * {@link org.springframework.vault.support.Certificate} .
69- * @since 2.0
7070 * @see <a href=
7171 * "https://www.vaultproject.io/docs/secrets/pki/index.html#pki-issue">POST
7272 * /pki/sign/[role name]</a>
73+ * @since 2.0
7374 */
7475 VaultSignCertificateRequestResponse signCertificateRequest (String roleName , String csr ,
7576 VaultCertificateRequest certificateRequest ) throws VaultException ;
@@ -79,10 +80,10 @@ VaultSignCertificateRequestResponse signCertificateRequest(String roleName, Stri
7980 * standard method of revoking using Vault lease IDs. A successful revocation will
8081 * rotate the CRL
8182 * @param serialNumber must not be empty or {@literal null}.
82- * @since 2.0
8383 * @see <a href=
8484 * "https://www.vaultproject.io/docs/secrets/pki/index.html#revoke-certificate">POST
8585 * /pki/revoke</a>
86+ * @since 2.0
8687 */
8788 void revoke (String serialNumber ) throws VaultException ;
8889
@@ -96,43 +97,56 @@ VaultSignCertificateRequestResponse signCertificateRequest(String roleName, Stri
9697 * is {@literal null}.
9798 * @return {@link java.io.InputStream} containing the encoded CRL or {@literal null}
9899 * if Vault responds with 204 No Content.
99- * @since 2.0
100100 * @see <a href="https://www.vaultproject.io/api/secret/pki/index.html#read-crl">GET
101101 * /pki/crl</a>
102+ * @since 2.0
102103 */
103104 @ Nullable
104105 InputStream getCrl (Encoding encoding ) throws VaultException ;
105106
106- enum Encoding {
107-
108- DER , PEM ,
109-
110- }
111-
112107 /**
113- * Retrieves the specified issuer's certificate. Includes the full ca_chain of the
114- * issuer.
108+ * Retrieves the specified issuer's certificate. Includes the full {@code ca_chain} of
109+ * the issuer.
115110 * @param issuer reference to an existing issuer, either by Vault-generated
116- * identifier, or the name assigned to an issuer. Pass the literal string 'default' to
117- * refer to the currently configured issuer.
111+ * identifier, or the name assigned to an issuer. Pass the literal string
112+ * {@code default} to refer to the currently configured issuer.
118113 * @return the {@link VaultIssuerCertificateRequestResponse} containing a
119114 * {@link org.springframework.vault.support.Certificate}
120115 * @see <a href=
121116 * "https://www.vaultproject.io/api/secret/pki/#read-issuer-certificate">GET *
122117 * /pki/issuer/:issuer_ref/json</a>
123- *
118+ * @since 3.1
124119 */
125120 VaultIssuerCertificateRequestResponse getIssuerCertificate (String issuer ) throws VaultException ;
126121
127122 /**
128- * Retrieves the specified issuer's certificate. Includes the full ca_chain of the
129- * issuer.
130- * @return {@link java.io.InputStream} containing the encoded certificate or
131- * {@literal null}
123+ * Retrieves the specified issuer's certificate. Includes the full {@code ca_chain} of
124+ * the issuer.
125+ * @param issuer reference to an existing issuer, either by Vault-generated
126+ * identifier, or the name assigned to an issuer. Pass the literal string
127+ * {@code default} to refer to the currently configured issuer.
128+ * @param encoding encoding to use.
129+ * @return {@link java.io.InputStream} containing the encoded certificate.
132130 * @see <a href=
133131 * "https://www.vaultproject.io/api/secret/pki/#read-issuer-certificate">GET
134132 * /pki/issuer/:issuer_ref/{der, pem}</a>
133+ * @since 3.1
135134 */
136135 InputStream getIssuerCertificate (String issuer , Encoding encoding ) throws VaultException ;
137136
137+ enum Encoding {
138+
139+ /**
140+ * DER (Distinguished Encoding Rules) format in its binary representation, see
141+ * X.690.
142+ */
143+ DER ,
144+
145+ /**
146+ * Privacy-Enhanced Mail (PEM) format in base64.
147+ */
148+ PEM ;
149+
150+ }
151+
138152}
0 commit comments