Package org.pgpainless.key.certification

# Class CertifyCertificate

java.lang.Object
org.pgpainless.key.certification.CertifyCertificate

public class CertifyCertificate extends Object
API for creating certifications and delegations (Signatures) on keys. This API can be used to sign another persons OpenPGP key. A certification over a user-id is thereby used to attest, that the user believes that the user-id really belongs to the owner of the certificate. A delegation over a key can be used to delegate trust by marking the certificate as a trusted introducer.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`CertifyCertificate.CertificationOnUserId`
`static class`
`CertifyCertificate.CertificationOnUserIdWithSubpackets`
`static class`
`CertifyCertificate.CertificationResult`
`static class`
`CertifyCertificate.DelegationOnCertificate`
`static class`
`CertifyCertificate.DelegationOnCertificateWithSubpackets`

## Constructor Summary

Constructors
Constructor
Description
`CertifyCertificate()`

## Method Summary

Modifier and Type
Method
Description
`CertifyCertificate.DelegationOnCertificate`
`certificate(org.bouncycastle.openpgp.PGPPublicKeyRing certificate)`
Create a delegation (direct key signature) over a certificate.
`CertifyCertificate.DelegationOnCertificate`
`certificate(org.bouncycastle.openpgp.PGPPublicKeyRing certificate, Trustworthiness trustworthiness)`
Create a delegation (direct key signature) containing a `TrustSignature` packet over a certificate.
`CertifyCertificate.CertificationOnUserId`
`userIdOnCertificate(String userId, org.bouncycastle.openpgp.PGPPublicKeyRing certificate)`
Create a certification over a User-Id.
`CertifyCertificate.CertificationOnUserId`
`userIdOnCertificate(String userid, org.bouncycastle.openpgp.PGPPublicKeyRing certificate, CertificationType certificationType)`
Create a certification of the given `CertificationType` over a User-Id.

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

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

## Constructor Details

### CertifyCertificate

public CertifyCertificate()

## Method Details

### userIdOnCertificate

public CertifyCertificate.CertificationOnUserId userIdOnCertificate(@Nonnull String userId, @Nonnull org.bouncycastle.openpgp.PGPPublicKeyRing certificate)
Create a certification over a User-Id. By default, this method will use `CertificationType.GENERIC` to create the signature. If you need to create another type of certification, use `userIdOnCertificate(String, PGPPublicKeyRing, CertificationType)` instead.

Parameters:
  `userId` - user-id to certify
  `certificate` - certificate
Returns:
  API

### userIdOnCertificate

public CertifyCertificate.CertificationOnUserId userIdOnCertificate(@Nonnull String userid, @Nonnull org.bouncycastle.openpgp.PGPPublicKeyRing certificate, @Nonnull CertificationType certificationType)
Create a certification of the given `CertificationType` over a User-Id.

Parameters:
  `userid` - user-id to certify
  `certificate` - certificate
  `certificationType` - type of signature
Returns:
  API

### certificate

public CertifyCertificate.DelegationOnCertificate certificate(@Nonnull org.bouncycastle.openpgp.PGPPublicKeyRing certificate)
Create a delegation (direct key signature) over a certificate. This can be used to mark a certificate as a trusted introducer (see `certificate(PGPPublicKeyRing, Trustworthiness)`).

Parameters:
  `certificate` - certificate
Returns:
  API

### certificate

public CertifyCertificate.DelegationOnCertificate certificate(@Nonnull org.bouncycastle.openpgp.PGPPublicKeyRing certificate, @Nullable Trustworthiness trustworthiness)
Create a delegation (direct key signature) containing a `TrustSignature` packet over a certificate. This can be used to mark a certificate as a trusted introducer.

Parameters:
  `certificate` - certificate
  `trustworthiness` - trustworthiness of the certificate
Returns:
  API