List of usage examples for org.springframework.vault.core VaultOperations read
@Nullable <T> VaultResponseSupport<T> read(String path, Class<T> responseType);
From source file:example.pki.CertificateUtil.java
/** * Find a valid, possibly cached, {@link CertificateBundle}. * * @param vaultProperties// w ww.j a v a 2s .c om * @param vaultOperations * @param pkiProperties * @return the {@link CertificateBundle} or {@literal null}. */ public static CertificateBundle findValidCertificate(VaultProperties vaultProperties, VaultOperations vaultOperations, VaultPkiProperties pkiProperties) { if (!pkiProperties.isReuseValidCertificate()) { return requestCertificate(vaultOperations, pkiProperties).getData(); } String cacheKey = createCacheKey(vaultProperties, pkiProperties); VaultResponseSupport<CachedCertificateBundle> readResponse = vaultOperations.read(cacheKey, CachedCertificateBundle.class); VaultHealth health = vaultOperations.opsForSys().health(); if (isValid(health, readResponse)) { logger.info("Found valid SSL certificate in Vault for: {}", pkiProperties.getCommonName()); return getCertificateBundle(readResponse); } return null; }