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()
).certificate
- the certificate content (either the PEM content itself or something that can be loaded byResourceUtils.getURL(java.lang.String)
)privateKey
- the private key content (either the PEM content itself or something that can be loaded byResourceUtils.getURL(java.lang.String)
)privateKeyPassword
- a password used to decrypt an encrypted private key
public record PemSslStoreDetails(String type, String certificate, 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
-
Constructor Summary
ConstructorDescriptionPemSslStoreDetails
(String type, String certificate, String privateKey) PemSslStoreDetails
(String type, String certificate, String privateKey, String privateKeyPassword) Creates an instance of aPemSslStoreDetails
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecertificate
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.final int
hashCode()
Returns a hash code value for this object.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.withPrivateKey
(String privateKey) Return a newPemSslStoreDetails
instance with a new private key.withPrivateKeyPassword
(String password) Return a newPemSslStoreDetails
instance with a new private key password.
-
Constructor Details
-
PemSslStoreDetails
-
PemSslStoreDetails
public PemSslStoreDetails(String type, String certificate, String privateKey, String privateKeyPassword) Creates an instance of aPemSslStoreDetails
record class.- Parameters:
type
- the value for thetype
record componentcertificate
- the value for thecertificate
record componentprivateKey
- the value for theprivateKey
record componentprivateKeyPassword
- the value for theprivateKeyPassword
record component
-
-
Method Details
-
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:
password
- the new private key password- Returns:
- a new
PemSslStoreDetails
instance
-
forCertificate
Factory method to create a newPemSslStoreDetails
instance for the given certificate.- Parameters:
certificate
- the certificate- Returns:
- a new
PemSslStoreDetails
instance.
-
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
-
certificate
Returns the value of thecertificate
record component.- Returns:
- the value of the
certificate
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
-