Class Certificate
java.lang.Object
org.springframework.vault.support.Certificate
- Direct Known Subclasses:
CertificateBundle
Value object representing a certificate consisting of the certificate and the issuer
certificate. Certificate and keys can be either DER or PEM (including PEM bundle)
encoded. Certificates can be obtained as
X509Certificate.- Since:
- 2.0
- Author:
- Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCreate a trust store asKeyStorefrom thisCertificatecontaining the certificate chain.Retrieve the certificate asX509Certificate.Retrieve the issuing CA certificate asX509Certificate.static CertificateCreate aCertificategiven a private key with certificates and the serial number.
-
Method Details
-
of
Create aCertificategiven a private key with certificates and the serial number.- Parameters:
serialNumber- must not be empty or null.certificate- must not be empty or null.issuingCaCertificate- must not be empty or null.- Returns:
- the
Certificate
-
getSerialNumber
- Returns:
- the serial number.
-
getCertificate
- Returns:
- encoded certificate (PEM or DER-encoded).
-
getIssuingCaCertificate
- Returns:
- encoded certificate of the issuing CA (PEM or DER-encoded).
-
getX509Certificate
Retrieve the certificate asX509Certificate.- Returns:
- the
X509Certificate. - Throws:
IllegalStateException- if there is no X.509 certificate available.
-
getX509IssuerCertificate
Retrieve the issuing CA certificate asX509Certificate.- Returns:
- the issuing CA
X509Certificate.
-
createTrustStore
Create a trust store asKeyStorefrom thisCertificatecontaining the certificate chain.- Returns:
- the
KeyStorecontaining the private key and certificate chain.
-