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 exampleJKS
orPKCS11
. Anull
value will useKeyStore.getDefaultType()
).alias
- the alias used when setting entries in theKeyStore
password
- the password usedsetting key entries
in theKeyStore
certificates
- the certificates content (either the PEM content itself or a reference to the resource to load). When aprivate key
is 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
ConstructorDescriptionPemSslStoreDetails
(String type, String certificate, String privateKey) Create a newPemSslStoreDetails
instance.PemSslStoreDetails
(String type, String certificate, String privateKey, String privateKeyPassword) Create a newPemSslStoreDetails
instance.PemSslStoreDetails
(String type, String alias, String password, String certificates, String privateKey, String privateKeyPassword) Create a newPemSslStoreDetails
instance. -
Method Summary
Modifier and TypeMethodDescriptionalias()
Returns the value of thealias
record component.Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of thecertificates
record component.final boolean
Indicates whether some other object is "equal to" this one.static PemSslStoreDetails
forCertificate
(String certificate) Factory method to create a newPemSslStoreDetails
instance for the given certificate.static PemSslStoreDetails
forCertificates
(String certificates) Factory method to create a newPemSslStoreDetails
instance for the given certificates.final int
hashCode()
Returns a hash code value for this object.password()
Returns the value of thepassword
record component.Returns the value of theprivateKey
record component.Returns the value of theprivateKeyPassword
record component.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.Return a newPemSslStoreDetails
instance with a new alias.withPassword
(String password) Return a newPemSslStoreDetails
instance with a new password.withPrivateKey
(String privateKey) Return a newPemSslStoreDetails
instance with a new private key.withPrivateKeyPassword
(String privateKeyPassword) Return a newPemSslStoreDetails
instance 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 newPemSslStoreDetails
instance.- Parameters:
type
- the key store type, for exampleJKS
orPKCS11
. Anull
value will useKeyStore.getDefaultType()
).alias
- the alias used when setting entries in theKeyStore
password
- the password usedsetting key entries
in theKeyStore
certificates
- 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 newPemSslStoreDetails
instance.- Parameters:
type
- the key store type, for exampleJKS
orPKCS11
. Anull
value 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 newPemSslStoreDetails
instance.- Parameters:
type
- the key store type, for exampleJKS
orPKCS11
. Anull
value 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 newPemSslStoreDetails
instance with a new alias.- Parameters:
alias
- the new alias- Returns:
- a new
PemSslStoreDetails
instance - Since:
- 3.2.0
-
withPassword
Return a newPemSslStoreDetails
instance with a new password.- Parameters:
password
- the new password- Returns:
- a new
PemSslStoreDetails
instance - Since:
- 3.2.0
-
withPrivateKey
Return a newPemSslStoreDetails
instance with a new private key.- Parameters:
privateKey
- the new private key- Returns:
- a new
PemSslStoreDetails
instance
-
withPrivateKeyPassword
Return a newPemSslStoreDetails
instance with a new private key password.- Parameters:
privateKeyPassword
- the new private key password- Returns:
- a new
PemSslStoreDetails
instance
-
forCertificate
Factory method to create a newPemSslStoreDetails
instance 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
PemSslStoreDetails
instance.
-
forCertificates
Factory method to create a newPemSslStoreDetails
instance 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
PemSslStoreDetails
instance. - 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 thetype
record component.- Returns:
- the value of the
type
record component
-
alias
Returns the value of thealias
record component.- Returns:
- the value of the
alias
record component
-
password
Returns the value of thepassword
record component.- Returns:
- the value of the
password
record component
-
certificates
Returns the value of thecertificates
record component.- Returns:
- the value of the
certificates
record component
-
privateKey
Returns the value of theprivateKey
record component.- Returns:
- the value of the
privateKey
record component
-
privateKeyPassword
Returns the value of theprivateKeyPassword
record component.- Returns:
- the value of the
privateKeyPassword
record component
-
certificates()