Interface PkiSecrets
- All Superinterfaces:
Secrets
API operation for Vault PKI Secrets Engine.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Engine<PkiSecrets> PKI secrets engine.static final StringEC (Elliptic curve) algorithm for keys.static final StringRSA algorithm for keys. -
Method Summary
Modifier and TypeMethodDescriptiondefault X509CertificateCertification authority certificate.caCertificate(CaCertificateGet.Request request) Certification authority certificate.default byte[]caCertificate(PkiFormat format) Certification authority certificate in raw bytes.certificate(CertificateGet.Request request) Get a certificate.default Optional<X509Certificate> certificate(String serialNumber) Certificate with the defined serial id.default Optional<byte[]> certificate(String serialNumber, PkiFormat format) Certificate in raw bytes, currently onlyPkiFormat.PEMis supported.createOrUpdateRole(PkiRole.Request request) This endpoint creates or updates the role definition.default X509CRLcrl()Certificate revocation list.crl(CrlGet.Request request) Get a CRL (certificate revocation list).default byte[]Certificate revocation list in raw bytes.Generate a self signed root certificate.default GenerateSelfSignedRoot.ResponsegenerateSelfSignedRoot(String commonName) Generate a self signed root certificate.issueCertificate(IssueCertificate.Request request) Issue a new certificate returning raw data.list(ListSecrets.Request request) List certificate serial numbers.Revoke a certificate.default InstantrevokeCertificate(String serialNumber) Revoke a certificate by its serial number.signCertificateRequest(SignCsr.Request request) This endpoint signs a new certificate based upon the provided CSR and the supplied parameters, subject to the restrictions contained in the role named in the endpoint.
-
Field Details
-
ENGINE
PKI secrets engine.Documentation: https://www.vaultproject.io/api-docs/secret/pki
-
KEY_TYPE_RSA
RSA algorithm for keys.- See Also:
-
KEY_TYPE_EC
EC (Elliptic curve) algorithm for keys.- See Also:
-
-
Method Details
-
list
List certificate serial numbers. -
caCertificate
Certification authority certificate.- Returns:
- certificate of the CA
-
caCertificate
Certification authority certificate in raw bytes.- Parameters:
format- format to use, eitherDERorPEMformat are supported- Returns:
- CA certificate bytes
-
caCertificate
Certification authority certificate.- Parameters:
request- request with optionalPkiFormatconfigured- Returns:
- CA certificate bytes
-
certificate
Certificate with the defined serial id.- Parameters:
serialNumber- serial number of the certificate- Returns:
- certificate, if not found, an exception is returned
-
certificate
Certificate in raw bytes, currently onlyPkiFormat.PEMis supported.- Parameters:
serialNumber- serial number of the certificateformat- format - must bePkiFormat.PEM- Returns:
- certificate bytes in
PEMformat
-
certificate
Get a certificate.- Parameters:
request- certificate request with at least the serial number- Returns:
- get certificate response
-
crl
Certificate revocation list.- Returns:
- revoke list
-
crl
Certificate revocation list in raw bytes.- Parameters:
format- to choose betweenPEMandDERencoding of the list- Returns:
- CRL bytes
-
crl
Get a CRL (certificate revocation list).- Parameters:
request- get CRL request- Returns:
- get CRL response
-
issueCertificate
Issue a new certificate returning raw data.The format of data returned depends on the
PkiFormatchosen:PkiFormat.PEM- pem bytes (e.g.-----BEGIN CERTIFICATE-----...)PkiFormat.PEM_BUNDLE- same as above, with certificate bundling the private keyPkiFormat.DER- binary encoding
- Parameters:
request- configuration of the new certificate- Returns:
- certificate response with bytes of returned certificates
-
signCertificateRequest
This endpoint signs a new certificate based upon the provided CSR and the supplied parameters, subject to the restrictions contained in the role named in the endpoint.- Parameters:
request- sign CSR request- Returns:
- a new certificate
-
revokeCertificate
Revoke a certificate by its serial number.- Parameters:
serialNumber- serial number of the certificate to revoke- Returns:
- revocation instant
-
revokeCertificate
Revoke a certificate.- Parameters:
request- revoke certificate request with at least the certificate serial number- Returns:
- revoke certificate response
-
generateSelfSignedRoot
Generate a self signed root certificate. This operations makes sense for testing. For production environments, this would most likely be initialized with an explicit key and certificate.- Parameters:
commonName- the common name (cn) of the certificate- Returns:
- when request finishes
-
generateSelfSignedRoot
Generate a self signed root certificate. This operations makes sense for testing. For production environments, this would most likely be initialized with an explicit key and certificate.- Parameters:
request- generate self signed root request with at least the common name configured- Returns:
- generate self signed root response
-
createOrUpdateRole
This endpoint creates or updates the role definition. Note that thePkiRole.Request.addAllowedDomain(String),PkiRole.Request.allowSubDomains(boolean),PkiRole.Request.allowGlobDomains(boolean), andPkiRole.Request.allowAnyName(boolean)are additive; between these options, and across multiple roles, nearly any issuing policy can be accommodated.PkiRole.Request.serverFlag(boolean),PkiRole.Request.clientFlag(boolean), andPkiRole.Request.codeSigningFlag(boolean)are additive as well. If a client requests a certificate that is not allowed by the CN policy in the role, the request is denied.- Parameters:
request- request modifying the role- Returns:
- when request finishes
-