Record Class PrivateKeyEncryptedFileStorage
java.lang.Object
java.lang.Record
org.graylog.security.certutil.privatekey.PrivateKeyEncryptedFileStorage
- All Implemented Interfaces:
PrivateKeyEncryptedStorage
public record PrivateKeyEncryptedFileStorage(Path privateKeyFilename)
extends Record
implements PrivateKeyEncryptedStorage
-
Constructor Summary
ConstructorDescriptionPrivateKeyEncryptedFileStorage
(Path privateKeyFilename) Creates an instance of aPrivateKeyEncryptedFileStorage
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theprivateKeyFilename
record component.readEncryptedKey
(char[] password) final String
toString()
Returns a string representation of this record class.void
writeEncryptedKey
(char[] password, PrivateKey privateKey)
-
Constructor Details
-
PrivateKeyEncryptedFileStorage
Creates an instance of aPrivateKeyEncryptedFileStorage
record class.- Parameters:
privateKeyFilename
- the value for theprivateKeyFilename
record component
-
-
Method Details
-
writeEncryptedKey
public void writeEncryptedKey(char[] password, PrivateKey privateKey) throws IOException, org.bouncycastle.operator.OperatorCreationException - Specified by:
writeEncryptedKey
in interfacePrivateKeyEncryptedStorage
- Throws:
IOException
org.bouncycastle.operator.OperatorCreationException
-
readEncryptedKey
public PrivateKey readEncryptedKey(char[] password) throws IOException, org.bouncycastle.pkcs.PKCSException - Specified by:
readEncryptedKey
in interfacePrivateKeyEncryptedStorage
- Throws:
IOException
org.bouncycastle.pkcs.PKCSException
-
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)
. -
privateKeyFilename
Returns the value of theprivateKeyFilename
record component.- Returns:
- the value of the
privateKeyFilename
record component
-