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()).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
ConstructorsConstructorDescriptionPemSslStoreDetails(String type, String certificate, String privateKey) PemSslStoreDetails(String type, String certificate, String privateKey, String privateKeyPassword) Creates an instance of aPemSslStoreDetailsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecertificaterecord 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.final inthashCode()Returns a hash code value for this object.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.withPrivateKey(String privateKey) Return a newPemSslStoreDetailsinstance with a new private key.withPrivateKeyPassword(String password) Return a newPemSslStoreDetailsinstance with a new private key password.
-
Constructor Details
-
PemSslStoreDetails
-
PemSslStoreDetails
public PemSslStoreDetails(String type, String certificate, String privateKey, String privateKeyPassword) Creates an instance of aPemSslStoreDetailsrecord class.- Parameters:
type- the value for thetyperecord componentcertificate- the value for thecertificaterecord componentprivateKey- the value for theprivateKeyrecord componentprivateKeyPassword- the value for theprivateKeyPasswordrecord component
-
-
Method Details
-
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:
password- the new private key password- Returns:
- a new
PemSslStoreDetailsinstance
-
forCertificate
Factory method to create a newPemSslStoreDetailsinstance for the given certificate.- Parameters:
certificate- the certificate- Returns:
- a new
PemSslStoreDetailsinstance.
-
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
-
certificate
Returns the value of thecertificaterecord component.- Returns:
- the value of the
certificaterecord 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
-