Class SignaturePicker
- java.lang.Object
-
- org.pgpainless.signature.consumer.SignaturePicker
-
public final class SignaturePicker extends Object
Pick signatures from keys. The format of a V4 OpenPGP key is: Primary-Key [Revocation Self Signature] [Direct Key Signature...] User ID [Signature ...] [User ID [Signature ...] ...] [User Attribute [Signature ...] ...] [[Subkey [Binding-Signature-Revocation] Primary-Key-Binding-Signature] ...]
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.bouncycastle.openpgp.PGPSignature
pickCurrentDirectKeySelfSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, Policy policy, Date validationDate)
Pick the at validationDate most recent, valid direct key signature.static org.bouncycastle.openpgp.PGPSignature
pickCurrentDirectKeySignature(org.bouncycastle.openpgp.PGPPublicKey signingKey, org.bouncycastle.openpgp.PGPPublicKey signedKey, Policy policy, Date validationDate)
Pick the at validationDate, latest, valid direct key signature made by signingKey on signedKey.static org.bouncycastle.openpgp.PGPSignature
pickCurrentRevocationSelfSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, Policy policy, Date validationDate)
Pick the at validation date most recent valid key revocation signature.static org.bouncycastle.openpgp.PGPSignature
pickCurrentSubkeyBindingRevocationSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, org.bouncycastle.openpgp.PGPPublicKey subkey, Policy policy, Date validationDate)
Pick the at validationDate most recent, valid subkey revocation signature.static org.bouncycastle.openpgp.PGPSignature
pickCurrentSubkeyBindingSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, org.bouncycastle.openpgp.PGPPublicKey subkey, Policy policy, Date validationDate)
Pick the at validationDate latest, valid subkey binding signature for the given subkey.static org.bouncycastle.openpgp.PGPSignature
pickCurrentUserIdCertificationSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, String userId, Policy policy, Date validationDate)
Pick the at validationDate latest, valid certification self-signature for the given user-id.static org.bouncycastle.openpgp.PGPSignature
pickCurrentUserIdRevocationSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, String userId, Policy policy, Date validationDate)
Pick the at validationDate most recent, valid user-id revocation signature.static org.bouncycastle.openpgp.PGPSignature
pickLatestDirectKeySignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, Policy policy, Date validationDate)
Pick the at validationDate latest direct key signature.static org.bouncycastle.openpgp.PGPSignature
pickLatestDirectKeySignature(org.bouncycastle.openpgp.PGPPublicKey signingKey, org.bouncycastle.openpgp.PGPPublicKey signedKey, Policy policy, Date validationDate)
Pick the at validationDate latest direct key signature made by signingKey on signedKey.static org.bouncycastle.openpgp.PGPSignature
pickLatestSubkeyBindingSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, org.bouncycastle.openpgp.PGPPublicKey subkey, Policy policy, Date validationDate)
Pick the at validationDate latest subkey binding signature for the given subkey.static org.bouncycastle.openpgp.PGPSignature
pickLatestUserIdCertificationSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, String userId, Policy policy, Date validationDate)
Pick the at validationDate latest certification self-signature for the given user-id.
-
-
-
Method Detail
-
pickCurrentRevocationSelfSignature
public static org.bouncycastle.openpgp.PGPSignature pickCurrentRevocationSelfSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, Policy policy, Date validationDate)
Pick the at validation date most recent valid key revocation signature. If there are hard revocation signatures, the latest hard revocation sig is picked, even if it was created after validationDate or if it is already expired.- Parameters:
keyRing
- key ring- Returns:
- most recent, valid key revocation signature
-
pickCurrentDirectKeySelfSignature
public static org.bouncycastle.openpgp.PGPSignature pickCurrentDirectKeySelfSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, Policy policy, Date validationDate)
Pick the at validationDate most recent, valid direct key signature. This method might return null, if there is no direct key self-signature which is valid at validationDate.- Parameters:
keyRing
- key ringvalidationDate
- validation date- Returns:
- direct-key self-signature
-
pickCurrentDirectKeySignature
public static org.bouncycastle.openpgp.PGPSignature pickCurrentDirectKeySignature(org.bouncycastle.openpgp.PGPPublicKey signingKey, org.bouncycastle.openpgp.PGPPublicKey signedKey, Policy policy, Date validationDate)
Pick the at validationDate, latest, valid direct key signature made by signingKey on signedKey. This method might return null, if there is no direct key self signature which is valid at validationDate.- Parameters:
signingKey
- key that created the signaturesignedKey
- key that carries the signaturevalidationDate
- validation date- Returns:
- direct key sig
-
pickLatestDirectKeySignature
public static org.bouncycastle.openpgp.PGPSignature pickLatestDirectKeySignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, Policy policy, Date validationDate)
Pick the at validationDate latest direct key signature. This method might return an expired signature. If there are more than one direct-key signature, and some of those are not expired, the latest non-expired yet already effective direct-key signature will be returned.- Parameters:
keyRing
- key ringvalidationDate
- validation date- Returns:
- latest direct key signature
-
pickLatestDirectKeySignature
public static org.bouncycastle.openpgp.PGPSignature pickLatestDirectKeySignature(org.bouncycastle.openpgp.PGPPublicKey signingKey, org.bouncycastle.openpgp.PGPPublicKey signedKey, Policy policy, Date validationDate)
Pick the at validationDate latest direct key signature made by signingKey on signedKey. This method might return an expired signature. If a non-expired direct-key signature exists, the latest non-expired yet already effective direct-key signature will be returned.- Parameters:
signingKey
- signing key (key that made the sig)signedKey
- signed key (key that carries the sig)validationDate
- date of validation- Returns:
- latest direct key sig
-
pickCurrentUserIdRevocationSignature
public static org.bouncycastle.openpgp.PGPSignature pickCurrentUserIdRevocationSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, String userId, Policy policy, Date validationDate)
Pick the at validationDate most recent, valid user-id revocation signature. If there are hard revocation signatures, the latest hard revocation sig is picked, even if it was created after validationDate or if it is already expired.- Parameters:
keyRing
- key ringuserId
- user-Id that gets revokedvalidationDate
- validation date- Returns:
- revocation signature
-
pickCurrentUserIdCertificationSignature
public static org.bouncycastle.openpgp.PGPSignature pickCurrentUserIdCertificationSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, String userId, Policy policy, Date validationDate)
Pick the at validationDate latest, valid certification self-signature for the given user-id. This method might return null, if there is no certification self signature for that user-id which is valid at validationDate.- Parameters:
keyRing
- keyringuserId
- useridvalidationDate
- validation date- Returns:
- user-id certification
-
pickLatestUserIdCertificationSignature
public static org.bouncycastle.openpgp.PGPSignature pickLatestUserIdCertificationSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, String userId, Policy policy, Date validationDate)
Pick the at validationDate latest certification self-signature for the given user-id. This method might return an expired signature. If a non-expired user-id certification signature exists, the latest non-expired yet already effective user-id certification signature for the given user-id will be returned.- Parameters:
keyRing
- keyringuserId
- useridvalidationDate
- validation date- Returns:
- user-id certification
-
pickCurrentSubkeyBindingRevocationSignature
public static org.bouncycastle.openpgp.PGPSignature pickCurrentSubkeyBindingRevocationSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, org.bouncycastle.openpgp.PGPPublicKey subkey, Policy policy, Date validationDate)
Pick the at validationDate most recent, valid subkey revocation signature. If there are hard revocation signatures, the latest hard revocation sig is picked, even if it was created after validationDate or if it is already expired.- Parameters:
keyRing
- keyringsubkey
- subkeyvalidationDate
- validation date- Returns:
- subkey revocation signature
-
pickCurrentSubkeyBindingSignature
public static org.bouncycastle.openpgp.PGPSignature pickCurrentSubkeyBindingSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, org.bouncycastle.openpgp.PGPPublicKey subkey, Policy policy, Date validationDate)
Pick the at validationDate latest, valid subkey binding signature for the given subkey. This method might return null, if there is no subkey binding signature which is valid at validationDate.- Parameters:
keyRing
- key ringsubkey
- subkeyvalidationDate
- date of validation- Returns:
- most recent valid subkey binding signature
-
pickLatestSubkeyBindingSignature
public static org.bouncycastle.openpgp.PGPSignature pickLatestSubkeyBindingSignature(org.bouncycastle.openpgp.PGPKeyRing keyRing, org.bouncycastle.openpgp.PGPPublicKey subkey, Policy policy, Date validationDate)
Pick the at validationDate latest subkey binding signature for the given subkey. This method might return an expired signature. If a non-expired subkey binding signature exists, the latest non-expired yet already effective subkey binding signature for the given subkey will be returned.- Parameters:
keyRing
- key ringsubkey
- subkeyvalidationDate
- validationDate- Returns:
- subkey binding signature
-
-