Package org.pgpainless.algorithm

# 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.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static final class`
`Trustworthiness.Builder`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`MARGINALLY_CONVINCED`
`static final int`
`NOT_TRUSTED`
`static final int`
`THRESHOLD_FULLY_CONVINCED`

## Constructor Summary

Constructors
Constructor
Description
`Trustworthiness(int amount, int depth)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`canIntroduce(int otherDepth)`
Return true, if the certified cert can introduce certificates with trust depth of
`boolean`
`canIntroduce(Trustworthiness other)`
Return true, if the certified cert can introduce certificates with the given
`static Trustworthiness.Builder`
`fullyTrusted()`
This means that we are fully convinced of the trustworthiness of the key.
`int`
`getAmount()`
Get the trust amount.
`int`
`getDepth()`
Get the depth of the trust signature.
`boolean`
`isFullyTrusted()`
Return true if the certificate is fully trusted.
`boolean`
`isIntroducer()`
Return true, if the cert is an introducer.
`boolean`
`isMarginallyTrusted()`
Return true if the certificate is at least marginally trusted.
`boolean`
`isNotTrusted()`
Returns true, if the trust amount is equal to 0.
`static Trustworthiness.Builder`
`marginallyTrusted()`
This means that we are marginally (partially) convinced of the trustworthiness of the key.
`static Trustworthiness.Builder`
`untrusted()`
This means that we do not trust the key.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### THRESHOLD_FULLY_CONVINCED

public static final int THRESHOLD_FULLY_CONVINCED

See Also:
  - Constant Field Values

### MARGINALLY_CONVINCED

public static final int MARGINALLY_CONVINCED

See Also:
  - Constant Field Values

### NOT_TRUSTED

public static final int NOT_TRUSTED

See Also:
  - Constant Field Values

## 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