Package org.springframework.boot.ssl.pem
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 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(String type, String alias, String password, String certificates, String privateKey, 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(String type, String certificate, String privateKey) Create a newPemSslStoreDetailsinstance.PemSslStoreDetails(String type, String certificate, String privateKey, String privateKeyPassword) Create a newPemSslStoreDetailsinstance.PemSslStoreDetails(String type, String alias, String password, String certificates, String privateKey, String privateKeyPassword) Create a newPemSslStoreDetailsinstance. -
Method Summary
Modifier and TypeMethodDescriptionalias()Returns the value of thealiasrecord component.Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of thecertificatesrecord component.final booleanIndicates whether some other object is "equal to" this one.static PemSslStoreDetailsforCertificate(String certificate) Factory method to create a newPemSslStoreDetailsinstance for the given certificate.static PemSslStoreDetailsforCertificates(String certificates) Factory method to create a newPemSslStoreDetailsinstance for the given certificates.final inthashCode()Returns a hash code value for this object.password()Returns the value of thepasswordrecord component.Returns the value of theprivateKeyrecord component.Returns the value of theprivateKeyPasswordrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.Return a newPemSslStoreDetailsinstance with a new alias.withPassword(String password) Return a newPemSslStoreDetailsinstance with a new password.withPrivateKey(String privateKey) Return a newPemSslStoreDetailsinstance with a new private key.withPrivateKeyPassword(String privateKeyPassword) Return a newPemSslStoreDetailsinstance with a new private key password.
-
Constructor Details
-
PemSslStoreDetails
public PemSslStoreDetails(String type, String alias, String password, String certificates, String privateKey, 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(String type, String certificate, String privateKey, 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
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
-
certificate
Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor ofcertificates()Return the certificate content.- Returns:
- the certificate content
-
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
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
alias
Returns the value of thealiasrecord component.- Returns:
- the value of the
aliasrecord component
-
password
Returns the value of thepasswordrecord component.- Returns:
- the value of the
passwordrecord component
-
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
-
certificates()