Package org.pgpainless.authentication

# Class CertificateAuthenticity

java.lang.Object
org.pgpainless.authentication.CertificateAuthenticity

public class CertificateAuthenticity extends Object

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`CertificateAuthenticity.CertificationChain`
`static class`
`CertificateAuthenticity.ChainLink`
A chain link contains a node in the trust chain.

## Constructor Summary

Constructors
Constructor
Description
`CertificateAuthenticity(org.bouncycastle.openpgp.PGPPublicKeyRing certificate, String userId, Map<CertificateAuthenticity.CertificationChain,Integer> certificationChains, int targetAmount)`

## Method Summary

Modifier and Type
Method
Description
`int`
`getAuthenticityPercentage()`
Return the degree of authentication of the binding in percent.
`org.bouncycastle.openpgp.PGPPublicKeyRing`
`getCertificate()`
`Map<CertificateAuthenticity.CertificationChain,Integer>`
`getCertificationChains()`
Return a map of `CertificationChains` and their respective effective trust amount.
`int`
`getTotalTrustAmount()`
`String`
`getUserId()`
`boolean`
`isAuthenticated()`
Return true, if the binding is authenticated to a sufficient degree.

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

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

## Constructor Details

### CertificateAuthenticity

public CertificateAuthenticity(@Nonnull org.bouncycastle.openpgp.PGPPublicKeyRing certificate, @Nonnull String userId, @Nonnull Map<CertificateAuthenticity.CertificationChain,Integer> certificationChains, int targetAmount)

## Method Details

### getUserId

@Nonnull public String getUserId()

### getCertificate

@Nonnull public org.bouncycastle.openpgp.PGPPublicKeyRing getCertificate()

### getTotalTrustAmount

public int getTotalTrustAmount()

### getAuthenticityPercentage

public int getAuthenticityPercentage()
Return the degree of authentication of the binding in percent. 100% means full authentication. Values smaller than 100% mean partial authentication.

Returns:
  authenticity in percent

### isAuthenticated

public boolean isAuthenticated()
Return true, if the binding is authenticated to a sufficient degree.

Returns:
  true if total gathered evidence outweighs the target trust amount.

### getCertificationChains

@Nonnull public Map<CertificateAuthenticity.CertificationChain,Integer> getCertificationChains()
Return a map of `CertificationChains` and their respective effective trust amount. The effective trust amount of a path might be smaller than its actual trust amount, for example if nodes of a path are used multiple times.

Returns:
  map of certification chains and their effective trust amounts