Class TlsPassword

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class TlsPassword extends GObject
An abstract interface representing a password used in TLS. Often used in user interaction such as unlocking a key storage token.
Since:
2.30
  • Constructor Details

    • TlsPassword

      public TlsPassword(MemorySegment address)
      Create a TlsPassword instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • TlsPassword

      public TlsPassword(Set<TlsPasswordFlags> flags, String description)
      Create a new GTlsPassword object.
      Parameters:
      flags - the password flags
      description - description of what the password is for
    • TlsPassword

      public TlsPassword(TlsPasswordFlags flags, String description)
      Create a new GTlsPassword object.
      Parameters:
      flags - the password flags
      description - description of what the password is for
    • TlsPassword

      public TlsPassword()
      Create a new TlsPassword.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the TlsPassword class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected TlsPassword asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • getDescription

      public String getDescription()
      Get a description string about what the password will be used for.
      Returns:
      The description of the password.
      Since:
      2.30
    • getFlags

      public Set<TlsPasswordFlags> getFlags()
      Get flags about the password.
      Returns:
      The flags about the password.
      Since:
      2.30
    • getValue

      public byte[] getValue()
      Get the password value. If length is not null then it will be filled in with the length of the password value. (Note that the password value is not nul-terminated, so you can only pass null for length in contexts where you know the password will have a certain fixed length.)
      Returns:
      The password value (owned by the password object).
      Since:
      2.30
    • getWarning

      public String getWarning()
      Get a user readable translated warning. Usually this warning is a representation of the password flags returned from g_tls_password_get_flags().
      Returns:
      The warning.
      Since:
      2.30
    • setDescription

      public void setDescription(String description)
      Set a description string about what the password will be used for.
      Parameters:
      description - The description of the password
      Since:
      2.30
    • setFlags

      public void setFlags(Set<TlsPasswordFlags> flags)
      Set flags about the password.
      Parameters:
      flags - The flags about the password
      Since:
      2.30
    • setFlags

      public void setFlags(TlsPasswordFlags... flags)
      Set flags about the password.
      Parameters:
      flags - The flags about the password
      Since:
      2.30
    • setValue

      public void setValue(@Nullable byte @Nullable [] value)

      Set the value for this password. The value will be copied by the password object.

      Specify the length, for a non-nul-terminated password. Pass -1 as length if using a nul-terminated password, and length will be calculated automatically. (Note that the terminating nul is not considered part of the password in this case.)

      Parameters:
      value - the new password value
      Since:
      2.30
    • setValueFull

      public void setValueFull(@Nullable byte @Nullable [] value)

      Provide the value for this password.

      The value will be owned by the password object, and later freed using the destroy function callback.

      Specify the length, for a non-nul-terminated password. Pass -1 as length if using a nul-terminated password, and length will be calculated automatically. (Note that the terminating nul is not considered part of the password in this case.)

      Parameters:
      value - the value for the password
      Since:
      2.30
    • setWarning

      public void setWarning(String warning)
      Set a user readable translated warning. Usually this warning is a representation of the password flags returned from g_tls_password_get_flags().
      Parameters:
      warning - The user readable warning
      Since:
      2.30
    • getDefaultWarning

      protected String getDefaultWarning()
      virtual method for g_tls_password_get_warning() if no value has been set using g_tls_password_set_warning()
    • builder

      public static TlsPassword.Builder<? extends TlsPassword.Builder> builder()
      A TlsPassword.Builder object constructs a TlsPassword with the specified properties. Use the various set...() methods to set properties, and finish construction with TlsPassword.Builder.build().
      Returns:
      the builder object