Record Class PemSslStoreDetails
java.lang.Object
java.lang.Record
org.springframework.boot.ssl.pem.PemSslStoreDetails
- Record Components:
type- the key store type, for exampleJKSorPKCS11. Anullvalue will useKeyStore.getDefaultType()).alias- the alias used when setting entries in theKeyStorepassword- the password usedsetting key entriesin theKeyStorecertificates- the certificates content (either the PEM content itself or a reference to the resource to load). When aprivate keyis present this value is treated as a certificate chain, otherwise it is treated a list of certificates that should all be registered.privateKey- the private key content (either the PEM content itself or a reference to the resource to load)privateKeyPassword- a password used to decrypt an encrypted private key
public record PemSslStoreDetails(@Nullable String type, @Nullable String alias, @Nullable String password, @Nullable String certificates, @Nullable String privateKey, @Nullable String privateKeyPassword)
extends Record
Details for an individual trust or key store in a
PemSslStoreBundle.- Since:
- 3.1.0
- Author:
- Scott Frederick, Phillip Webb
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPemSslStoreDetails(@Nullable String type, @Nullable String certificate, @Nullable String privateKey) Create a newPemSslStoreDetailsinstance.PemSslStoreDetails(@Nullable String type, @Nullable String certificate, @Nullable String privateKey, @Nullable String privateKeyPassword) Create a newPemSslStoreDetailsinstance.PemSslStoreDetails(@Nullable String type, @Nullable String alias, @Nullable String password, @Nullable String certificates, @Nullable String privateKey, @Nullable String privateKeyPassword) Create a newPemSslStoreDetailsinstance. -
Method Summary
Modifier and TypeMethodDescription@Nullable Stringalias()Returns the value of thealiasrecord component.@Nullable StringReturns the value of thecertificatesrecord component.final booleanIndicates whether some other object is "equal to" this one.static PemSslStoreDetailsforCertificate(@Nullable String certificate) Factory method to create a newPemSslStoreDetailsinstance for the given certificate.static PemSslStoreDetailsforCertificates(@Nullable String certificates) Factory method to create a newPemSslStoreDetailsinstance for the given certificates.final inthashCode()Returns a hash code value for this object.@Nullable Stringpassword()Returns the value of thepasswordrecord component.@Nullable StringReturns the value of theprivateKeyrecord component.@Nullable StringReturns the value of theprivateKeyPasswordrecord component.final StringtoString()Returns a string representation of this record class.@Nullable Stringtype()Returns the value of thetyperecord component.Return a newPemSslStoreDetailsinstance with a new alias.withPassword(@Nullable String password) Return a newPemSslStoreDetailsinstance with a new password.withPrivateKey(@Nullable String privateKey) Return a newPemSslStoreDetailsinstance with a new private key.withPrivateKeyPassword(@Nullable String privateKeyPassword) Return a newPemSslStoreDetailsinstance with a new private key password.
-
Constructor Details
-
PemSslStoreDetails
public PemSslStoreDetails(@Nullable String type, @Nullable String alias, @Nullable String password, @Nullable String certificates, @Nullable String privateKey, @Nullable String privateKeyPassword) Create a newPemSslStoreDetailsinstance.- Parameters:
type- the key store type, for exampleJKSorPKCS11. Anullvalue will useKeyStore.getDefaultType()).alias- the alias used when setting entries in theKeyStorepassword- the password usedsetting key entriesin theKeyStorecertificates- the certificate content (either the PEM content itself or a reference to the resource to load)privateKey- the private key content (either the PEM content itself or a reference to the resource to load)privateKeyPassword- a password used to decrypt an encrypted private key- Since:
- 3.2.0
-
PemSslStoreDetails
public PemSslStoreDetails(@Nullable String type, @Nullable String certificate, @Nullable String privateKey, @Nullable String privateKeyPassword) Create a newPemSslStoreDetailsinstance.- Parameters:
type- the key store type, for exampleJKSorPKCS11. Anullvalue will useKeyStore.getDefaultType()).certificate- the certificate content (either the PEM content itself or a reference to the resource to load)privateKey- the private key content (either the PEM content itself or a reference to the resource to load)privateKeyPassword- a password used to decrypt an encrypted private key
-
PemSslStoreDetails
public PemSslStoreDetails(@Nullable String type, @Nullable String certificate, @Nullable String privateKey) Create a newPemSslStoreDetailsinstance.- Parameters:
type- the key store type, for exampleJKSorPKCS11. Anullvalue will useKeyStore.getDefaultType()).certificate- the certificate content (either the PEM content itself or a reference to the resource to load)privateKey- the private key content (either the PEM content itself or a reference to the resource to load)
-
-
Method Details
-
withAlias
Return a newPemSslStoreDetailsinstance with a new alias.- Parameters:
alias- the new alias- Returns:
- a new
PemSslStoreDetailsinstance - Since:
- 3.2.0
-
withPassword
Return a newPemSslStoreDetailsinstance with a new password.- Parameters:
password- the new password- Returns:
- a new
PemSslStoreDetailsinstance - Since:
- 3.2.0
-
withPrivateKey
Return a newPemSslStoreDetailsinstance with a new private key.- Parameters:
privateKey- the new private key- Returns:
- a new
PemSslStoreDetailsinstance
-
withPrivateKeyPassword
Return a newPemSslStoreDetailsinstance with a new private key password.- Parameters:
privateKeyPassword- the new private key password- Returns:
- a new
PemSslStoreDetailsinstance
-
forCertificate
Factory method to create a newPemSslStoreDetailsinstance for the given certificate. Note: This method doesn't actually check if the provided value only contains a single certificate. It is functionally equivalent toforCertificates(String).- Parameters:
certificate- the certificate content (either the PEM content itself or a reference to the resource to load)- Returns:
- a new
PemSslStoreDetailsinstance.
-
forCertificates
Factory method to create a newPemSslStoreDetailsinstance for the given certificates.- Parameters:
certificates- the certificates content (either the PEM content itself or a reference to the resource to load)- Returns:
- a new
PemSslStoreDetailsinstance. - Since:
- 3.2.0
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
type
-
alias
-
password
-
certificates
Returns the value of thecertificatesrecord component.- Returns:
- the value of the
certificatesrecord component
-
privateKey
Returns the value of theprivateKeyrecord component.- Returns:
- the value of the
privateKeyrecord component
-
privateKeyPassword
Returns the value of theprivateKeyPasswordrecord component.- Returns:
- the value of the
privateKeyPasswordrecord component
-