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 Details

    • PrivateKeyEncryptedFileStorage

      public PrivateKeyEncryptedFileStorage(Path privateKeyFilename)
      Creates an instance of a PrivateKeyEncryptedFileStorage record class.
      Parameters:
      privateKeyFilename - the value for the privateKeyFilename record component
  • Method Details

    • writeEncryptedKey

      public void writeEncryptedKey(char[] password, PrivateKey privateKey) throws IOException, org.bouncycastle.operator.OperatorCreationException
      Specified by:
      writeEncryptedKey in interface PrivateKeyEncryptedStorage
      Throws:
      IOException
      org.bouncycastle.operator.OperatorCreationException
    • readEncryptedKey

      public PrivateKey readEncryptedKey(char[] password) throws IOException, org.bouncycastle.pkcs.PKCSException
      Specified by:
      readEncryptedKey in interface PrivateKeyEncryptedStorage
      Throws:
      IOException
      org.bouncycastle.pkcs.PKCSException
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • privateKeyFilename

      public Path privateKeyFilename()
      Returns the value of the privateKeyFilename record component.
      Returns:
      the value of the privateKeyFilename record component