Spring / Spring CredHub Interview questions
Why would you choose CertificateCredential over a generic JsonCredential for TLS material?
CertificateCredential is a purpose-built type with dedicated fields for the certificate authority, the certificate itself, and the private key, plus support for CredHub's certificate-specific operations — generation with SAN/key-usage parameters, and regeneration with a transitional version so an old and new certificate can be valid at the same time during rotation.
A JsonCredential holding the same three strings would work for simple storage, but you'd lose all of that: CredHub wouldn't know the value is a certificate, so generating it couldn't use certificate parameters, and the transitional-version regeneration that manages rotation wouldn't apply to it at all.
In short, use CertificateCredential whenever the value actually is a certificate, so CredHub's certificate-aware lifecycle features stay available.
More Related questions...