Interface PublicKey


public interface PublicKey
The public key can be used to verify signatures.
Since:
2.4.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the contacts of the publickey.
    Returns id of the public key.
    Returns the username of the owner or an empty optional.
    Returns raw of the public key.
    default Set<String>
    Returns ids from gpg sub keys.
    default boolean
    verify(byte[] data, byte[] signature)
    Verifies that the signature is valid for the given data.
    boolean
    verify(InputStream stream, byte[] signature)
    Verifies that the signature is valid for the given data.
  • Method Details

    • getId

      String getId()
      Returns id of the public key.
    • getSubkeys

      default Set<String> getSubkeys()
      Returns ids from gpg sub keys.
      Since:
      2.19.0
    • getOwner

      Optional<String> getOwner()
      Returns the username of the owner or an empty optional.
    • getRaw

      String getRaw()
      Returns raw of the public key.
    • getContacts

      Set<Person> getContacts()
      Returns the contacts of the publickey.
      Returns:
      owner or empty optional
    • verify

      boolean verify(InputStream stream, byte[] signature)
      Verifies that the signature is valid for the given data.
      Parameters:
      stream - stream of data to verify
      signature - signature
      Returns:
      true if the signature is valid for the given data
    • verify

      default boolean verify(byte[] data, byte[] signature)
      Verifies that the signature is valid for the given data.
      Parameters:
      data - data to verify
      signature - signature
      Returns:
      true if the signature is valid for the given data