Class Trustworthiness

java.lang.Object
org.pgpainless.algorithm.Trustworthiness

public class Trustworthiness extends Object
Facade class for TrustSignature. A trust signature subpacket marks the trustworthiness of a certificate and defines its capabilities to act as a trusted introducer.
  • Field Details

  • Constructor Details

    • Trustworthiness

      public Trustworthiness(int amount, int depth)
  • Method Details

    • getAmount

      public int getAmount()
      Get the trust amount. This value means how confident the issuer of the signature is in validity of the binding.
      Returns:
      trust amount
    • getDepth

      public int getDepth()
      Get the depth of the trust signature. This value controls, whether the certificate can act as a trusted introducer.
      Returns:
      depth
    • isNotTrusted

      public boolean isNotTrusted()
      Returns true, if the trust amount is equal to 0. This means the key is not trusted. Otherwise return false
      Returns:
      true if untrusted
    • isMarginallyTrusted

      public boolean isMarginallyTrusted()
      Return true if the certificate is at least marginally trusted. That is the case, if the trust amount is greater than 0.
      Returns:
      true if the cert is at least marginally trusted
    • isFullyTrusted

      public boolean isFullyTrusted()
      Return true if the certificate is fully trusted. That is the case if the trust amount is greater than or equal to 120.
      Returns:
      true if the cert is fully trusted
    • isIntroducer

      public boolean isIntroducer()
      Return true, if the cert is an introducer. That is the case if the depth is greater 0.
      Returns:
      true if introducer
    • canIntroduce

      public boolean canIntroduce(int otherDepth)
      Return true, if the certified cert can introduce certificates with trust depth of
      otherDepth
      .
      Parameters:
      otherDepth - other certifications trust depth
      Returns:
      true if the cert can introduce the other
    • canIntroduce

      public boolean canIntroduce(Trustworthiness other)
      Return true, if the certified cert can introduce certificates with the given
      other
      trust depth.
      Parameters:
      other - other certificates trust depth
      Returns:
      true if the cert can introduce the other
    • fullyTrusted

      public static Trustworthiness.Builder fullyTrusted()
      This means that we are fully convinced of the trustworthiness of the key.
      Returns:
      builder
    • marginallyTrusted

      public static Trustworthiness.Builder marginallyTrusted()
      This means that we are marginally (partially) convinced of the trustworthiness of the key.
      Returns:
      builder
    • untrusted

      public static Trustworthiness.Builder untrusted()
      This means that we do not trust the key. Can be used to overwrite previous trust.
      Returns:
      builder