Package io.github.mahmoudimus.quic.tls
Record Class CertifiedKey
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.tls.CertifiedKey
- Record Components:
chain- the certificates, end-entity first; never emptyprivateKey- the end-entity certificate's private key: EC (P-256 or P-384), RSA or Ed25519
A certificate chain, end-entity certificate first, and the private key for that certificate:
what a server, or a client asked for a certificate, presents and signs with.
-
Constructor Summary
ConstructorsConstructorDescriptionCertifiedKey(List<X509Certificate> chain, PrivateKey privateKey) Validates and copies the chain. -
Method Summary
Modifier and TypeMethodDescriptionchain()Returns the value of thechainrecord component.final booleanIndicates whether some other object is "equal to" this one.static CertifiedKeyfromKeyManager(X509KeyManager keyManager, String alias) The chain and key a key manager holds under an alias.final inthashCode()Returns a hash code value for this object.static CertifiedKeyof(PrivateKey privateKey, X509Certificate... chain) A certified key from a chain given as varargs.Returns the value of theprivateKeyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CertifiedKey
Validates and copies the chain.- Parameters:
chain- the certificates, end-entity first; never emptyprivateKey- the end-entity certificate's private key
-
-
Method Details
-
of
A certified key from a chain given as varargs.- Parameters:
privateKey- the end-entity certificate's private keychain- the certificates, end-entity first- Returns:
- the certified key
-
fromKeyManager
The chain and key a key manager holds under an alias.- Parameters:
keyManager- the key manager, such as one from aKeyManagerFactoryalias- the alias of the key entry- Returns:
- the certified key
- Throws:
IllegalArgumentException- if the key manager has no chain or key for the alias
-
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). -
chain
Returns the value of thechainrecord component.- Returns:
- the value of the
chainrecord component
-
privateKey
Returns the value of theprivateKeyrecord component.- Returns:
- the value of the
privateKeyrecord component
-