mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-15 17:02:06 +01:00
Change return values of signature subpackets subclasses
This commit is contained in:
parent
ed96bcd109
commit
8c49d37e1f
6 changed files with 135 additions and 103 deletions
|
@ -44,10 +44,12 @@ public abstract class AbstractSignatureBuilder<B extends AbstractSignatureBuilde
|
|||
this.hashAlgorithm = negotiateHashAlgorithm(publicSigningKey);
|
||||
|
||||
unhashedSubpackets = SignatureSubpacketGeneratorWrapper.createEmptySubpackets();
|
||||
// Prepopulate hashed subpackets with default values (key-id etc.)
|
||||
hashedSubpackets = SignatureSubpacketGeneratorWrapper.createHashedSubpackets(publicSigningKey);
|
||||
}
|
||||
|
||||
public AbstractSignatureBuilder(PGPSecretKey certificationKey, SecretKeyRingProtector protector, PGPSignature archetypeSignature) throws WrongPassphraseException {
|
||||
public AbstractSignatureBuilder(PGPSecretKey certificationKey, SecretKeyRingProtector protector, PGPSignature archetypeSignature)
|
||||
throws WrongPassphraseException {
|
||||
SignatureType type = SignatureType.valueOf(archetypeSignature.getSignatureType());
|
||||
if (!isValidSignatureType(type)) {
|
||||
throw new IllegalArgumentException("Invalid signature type.");
|
||||
|
@ -61,12 +63,26 @@ public abstract class AbstractSignatureBuilder<B extends AbstractSignatureBuilde
|
|||
hashedSubpackets = SignatureSubpacketGeneratorWrapper.refreshHashedSubpackets(publicSigningKey, archetypeSignature);
|
||||
}
|
||||
|
||||
/**
|
||||
* Negotiate a {@link HashAlgorithm} to be used when creating the signature.
|
||||
*
|
||||
* @param publicKey signing public key
|
||||
* @return hash algorithm
|
||||
*/
|
||||
protected HashAlgorithm negotiateHashAlgorithm(PGPPublicKey publicKey) {
|
||||
Set<HashAlgorithm> hashAlgorithmPreferences = OpenPgpKeyAttributeUtil.getOrGuessPreferredHashAlgorithms(publicKey);
|
||||
return HashAlgorithmNegotiator.negotiateSignatureHashAlgorithm(PGPainless.getPolicy())
|
||||
.negotiateHashAlgorithm(hashAlgorithmPreferences);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the builders {@link SignatureType}.
|
||||
* Note that only those types who are valid for the concrete subclass of this {@link AbstractSignatureBuilder}
|
||||
* are allowed. Invalid choices result in an {@link IllegalArgumentException} to be thrown.
|
||||
*
|
||||
* @param type signature type
|
||||
* @return builder
|
||||
*/
|
||||
public B setSignatureType(SignatureType type) {
|
||||
if (!isValidSignatureType(type)) {
|
||||
throw new IllegalArgumentException("Invalid signature type: " + type);
|
||||
|
@ -75,6 +91,13 @@ public abstract class AbstractSignatureBuilder<B extends AbstractSignatureBuilde
|
|||
return (B) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build an instance of {@link PGPSignatureGenerator} initialized with the signing key
|
||||
* and with hashed and unhashed subpackets.
|
||||
*
|
||||
* @return pgp signature generator
|
||||
* @throws PGPException
|
||||
*/
|
||||
protected PGPSignatureGenerator buildAndInitSignatureGenerator() throws PGPException {
|
||||
PGPSignatureGenerator generator = new PGPSignatureGenerator(
|
||||
ImplementationFactory.getInstance().getPGPContentSignerBuilder(
|
||||
|
@ -87,5 +110,12 @@ public abstract class AbstractSignatureBuilder<B extends AbstractSignatureBuilde
|
|||
return generator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the given {@link SignatureType} is a valid choice for the concrete implementation
|
||||
* of {@link AbstractSignatureBuilder}.
|
||||
*
|
||||
* @param type type
|
||||
* @return return true if valid, false otherwise
|
||||
*/
|
||||
protected abstract boolean isValidSignatureType(SignatureType type);
|
||||
}
|
||||
|
|
|
@ -28,91 +28,85 @@ import org.pgpainless.algorithm.PublicKeyAlgorithm;
|
|||
|
||||
public interface BaseSignatureSubpackets {
|
||||
|
||||
interface Callback {
|
||||
default void modifyHashedSubpackets(SignatureSubpacketGeneratorWrapper subpackets) {
|
||||
interface Callback extends SignatureSubpacketCallback<SignatureSubpacketGeneratorWrapper> {
|
||||
|
||||
}
|
||||
|
||||
default void modifyUnhashedSubpackets(SignatureSubpacketGeneratorWrapper subpackets) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setIssuerFingerprintAndKeyId(PGPPublicKey key);
|
||||
BaseSignatureSubpackets setIssuerFingerprintAndKeyId(PGPPublicKey key);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setIssuerKeyId(long keyId);
|
||||
BaseSignatureSubpackets setIssuerKeyId(long keyId);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setIssuerKeyId(boolean isCritical, long keyId);
|
||||
BaseSignatureSubpackets setIssuerKeyId(boolean isCritical, long keyId);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setIssuerKeyId(@Nullable IssuerKeyID issuerKeyID);
|
||||
BaseSignatureSubpackets setIssuerKeyId(@Nullable IssuerKeyID issuerKeyID);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setIssuerFingerprint(@Nonnull PGPPublicKey key);
|
||||
BaseSignatureSubpackets setIssuerFingerprint(@Nonnull PGPPublicKey key);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setIssuerFingerprint(boolean isCritical, @Nonnull PGPPublicKey key);
|
||||
BaseSignatureSubpackets setIssuerFingerprint(boolean isCritical, @Nonnull PGPPublicKey key);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setIssuerFingerprint(@Nullable IssuerFingerprint fingerprint);
|
||||
BaseSignatureSubpackets setIssuerFingerprint(@Nullable IssuerFingerprint fingerprint);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureCreationTime(@Nonnull Date creationTime);
|
||||
BaseSignatureSubpackets setSignatureCreationTime(@Nonnull Date creationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureCreationTime(boolean isCritical, @Nonnull Date creationTime);
|
||||
BaseSignatureSubpackets setSignatureCreationTime(boolean isCritical, @Nonnull Date creationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureCreationTime(@Nullable SignatureCreationTime signatureCreationTime);
|
||||
BaseSignatureSubpackets setSignatureCreationTime(@Nullable SignatureCreationTime signatureCreationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureExpirationTime(@Nonnull Date creationTime, @Nonnull Date expirationTime);
|
||||
BaseSignatureSubpackets setSignatureExpirationTime(@Nonnull Date creationTime, @Nonnull Date expirationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureExpirationTime(boolean isCritical, @Nonnull Date creationTime, @Nonnull Date expirationTime);
|
||||
BaseSignatureSubpackets setSignatureExpirationTime(boolean isCritical, @Nonnull Date creationTime, @Nonnull Date expirationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureExpirationTime(boolean isCritical, long seconds);
|
||||
BaseSignatureSubpackets setSignatureExpirationTime(boolean isCritical, long seconds);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureExpirationTime(@Nullable SignatureExpirationTime expirationTime);
|
||||
BaseSignatureSubpackets setSignatureExpirationTime(@Nullable SignatureExpirationTime expirationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignerUserId(@Nonnull String userId);
|
||||
BaseSignatureSubpackets setSignerUserId(@Nonnull String userId);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignerUserId(boolean isCritical, @Nonnull String userId);
|
||||
BaseSignatureSubpackets setSignerUserId(boolean isCritical, @Nonnull String userId);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignerUserId(@Nullable SignerUserID signerUserId);
|
||||
BaseSignatureSubpackets setSignerUserId(@Nullable SignerUserID signerUserId);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addNotationData(boolean isCritical, @Nonnull String notationName, @Nonnull String notationValue);
|
||||
BaseSignatureSubpackets addNotationData(boolean isCritical, @Nonnull String notationName, @Nonnull String notationValue);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addNotationData(boolean isCritical, boolean isHumanReadable, @Nonnull String notationName, @Nonnull String notationValue);
|
||||
BaseSignatureSubpackets addNotationData(boolean isCritical, boolean isHumanReadable, @Nonnull String notationName, @Nonnull String notationValue);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addNotationData(@Nonnull NotationData notationData);
|
||||
BaseSignatureSubpackets addNotationData(@Nonnull NotationData notationData);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper clearNotationData();
|
||||
BaseSignatureSubpackets clearNotationData();
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addIntendedRecipientFingerprint(@Nonnull PGPPublicKey recipient);
|
||||
BaseSignatureSubpackets addIntendedRecipientFingerprint(@Nonnull PGPPublicKey recipient);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addIntendedRecipientFingerprint(boolean isCritical, @Nonnull PGPPublicKey recipient);
|
||||
BaseSignatureSubpackets addIntendedRecipientFingerprint(boolean isCritical, @Nonnull PGPPublicKey recipient);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addIntendedRecipientFingerprint(IntendedRecipientFingerprint intendedRecipientFingerprint);
|
||||
BaseSignatureSubpackets addIntendedRecipientFingerprint(IntendedRecipientFingerprint intendedRecipientFingerprint);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper clearIntendedRecipientFingerprints();
|
||||
BaseSignatureSubpackets clearIntendedRecipientFingerprints();
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setExportable(boolean isCritical, boolean isExportable);
|
||||
BaseSignatureSubpackets setExportable(boolean isCritical, boolean isExportable);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setExportable(@Nullable Exportable exportable);
|
||||
BaseSignatureSubpackets setExportable(@Nullable Exportable exportable);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setRevocable(boolean isCritical, boolean isRevocable);
|
||||
BaseSignatureSubpackets setRevocable(boolean isCritical, boolean isRevocable);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setRevocable(@Nullable Revocable revocable);
|
||||
BaseSignatureSubpackets setRevocable(@Nullable Revocable revocable);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureTarget(@Nonnull PublicKeyAlgorithm keyAlgorithm, @Nonnull HashAlgorithm hashAlgorithm, @Nonnull byte[] hashData);
|
||||
BaseSignatureSubpackets setSignatureTarget(@Nonnull PublicKeyAlgorithm keyAlgorithm, @Nonnull HashAlgorithm hashAlgorithm, @Nonnull byte[] hashData);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureTarget(boolean isCritical, @Nonnull PublicKeyAlgorithm keyAlgorithm, @Nonnull HashAlgorithm hashAlgorithm, @Nonnull byte[] hashData);
|
||||
BaseSignatureSubpackets setSignatureTarget(boolean isCritical, @Nonnull PublicKeyAlgorithm keyAlgorithm, @Nonnull HashAlgorithm hashAlgorithm, @Nonnull byte[] hashData);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureTarget(@Nullable SignatureTarget signatureTarget);
|
||||
BaseSignatureSubpackets setSignatureTarget(@Nullable SignatureTarget signatureTarget);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setTrust(int depth, int amount);
|
||||
BaseSignatureSubpackets setTrust(int depth, int amount);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setTrust(boolean isCritical, int depth, int amount);
|
||||
BaseSignatureSubpackets setTrust(boolean isCritical, int depth, int amount);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setTrust(@Nullable TrustSignature trust);
|
||||
BaseSignatureSubpackets setTrust(@Nullable TrustSignature trust);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addEmbeddedSignature(@Nonnull PGPSignature signature) throws IOException;
|
||||
BaseSignatureSubpackets addEmbeddedSignature(@Nonnull PGPSignature signature) throws IOException;
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addEmbeddedSignature(boolean isCritical, @Nonnull PGPSignature signature) throws IOException;
|
||||
BaseSignatureSubpackets addEmbeddedSignature(boolean isCritical, @Nonnull PGPSignature signature) throws IOException;
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addEmbeddedSignature(@Nonnull EmbeddedSignature embeddedSignature);
|
||||
BaseSignatureSubpackets addEmbeddedSignature(@Nonnull EmbeddedSignature embeddedSignature);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper clearEmbeddedSignatures();
|
||||
BaseSignatureSubpackets clearEmbeddedSignatures();
|
||||
}
|
||||
|
|
|
@ -6,13 +6,7 @@ package org.pgpainless.signature.subpackets;
|
|||
|
||||
public interface CertificationSubpackets extends BaseSignatureSubpackets {
|
||||
|
||||
interface Callback {
|
||||
default void modifyHashedSubpackets(CertificationSubpackets subpackets) {
|
||||
interface Callback extends SignatureSubpacketCallback<BaseSignatureSubpackets> {
|
||||
|
||||
}
|
||||
|
||||
default void modifyUnhashedSubpackets(CertificationSubpackets subpackets) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,21 +12,15 @@ import org.pgpainless.key.util.RevocationAttributes;
|
|||
|
||||
public interface RevocationSignatureSubpackets extends BaseSignatureSubpackets {
|
||||
|
||||
interface Callback {
|
||||
default void modifyHashedSubpackets(RevocationSignatureSubpackets subpackets) {
|
||||
interface Callback extends SignatureSubpacketCallback<RevocationSignatureSubpackets> {
|
||||
|
||||
}
|
||||
|
||||
default void modifyUnhashedSubpackets(RevocationSignatureSubpackets subpackets) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setRevocationReason(RevocationAttributes revocationAttributes);
|
||||
RevocationSignatureSubpackets setRevocationReason(RevocationAttributes revocationAttributes);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setRevocationReason(boolean isCritical, RevocationAttributes revocationAttributes);
|
||||
RevocationSignatureSubpackets setRevocationReason(boolean isCritical, RevocationAttributes revocationAttributes);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setRevocationReason(boolean isCritical, RevocationAttributes.Reason reason, @Nonnull String description);
|
||||
RevocationSignatureSubpackets setRevocationReason(boolean isCritical, RevocationAttributes.Reason reason, @Nonnull String description);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setRevocationReason(@Nullable RevocationReason reason);
|
||||
RevocationSignatureSubpackets setRevocationReason(@Nullable RevocationReason reason);
|
||||
}
|
||||
|
|
|
@ -24,75 +24,69 @@ import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
|||
|
||||
public interface SelfSignatureSubpackets extends BaseSignatureSubpackets {
|
||||
|
||||
interface Callback {
|
||||
default void modifyHashedSubpackets(SelfSignatureSubpackets subpackets) {
|
||||
interface Callback extends SignatureSubpacketCallback<SelfSignatureSubpackets> {
|
||||
|
||||
}
|
||||
|
||||
default void modifyUnhashedSubpackets(SelfSignatureSubpackets subpackets) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyFlags(KeyFlag... keyFlags);
|
||||
SelfSignatureSubpackets setKeyFlags(KeyFlag... keyFlags);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyFlags(boolean isCritical, KeyFlag... keyFlags);
|
||||
SelfSignatureSubpackets setKeyFlags(boolean isCritical, KeyFlag... keyFlags);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyFlags(@Nullable KeyFlags keyFlags);
|
||||
SelfSignatureSubpackets setKeyFlags(@Nullable KeyFlags keyFlags);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPrimaryUserId();
|
||||
SelfSignatureSubpackets setPrimaryUserId();
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPrimaryUserId(boolean isCritical);
|
||||
SelfSignatureSubpackets setPrimaryUserId(boolean isCritical);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPrimaryUserId(@Nullable PrimaryUserID primaryUserId);
|
||||
SelfSignatureSubpackets setPrimaryUserId(@Nullable PrimaryUserID primaryUserId);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyExpirationTime(@Nonnull PGPPublicKey key, @Nonnull Date keyExpirationTime);
|
||||
SelfSignatureSubpackets setKeyExpirationTime(@Nonnull PGPPublicKey key, @Nonnull Date keyExpirationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyExpirationTime(@Nonnull Date keyCreationTime, @Nonnull Date keyExpirationTime);
|
||||
SelfSignatureSubpackets setKeyExpirationTime(@Nonnull Date keyCreationTime, @Nonnull Date keyExpirationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyExpirationTime(boolean isCritical, @Nonnull Date keyCreationTime, @Nonnull Date keyExpirationTime);
|
||||
SelfSignatureSubpackets setKeyExpirationTime(boolean isCritical, @Nonnull Date keyCreationTime, @Nonnull Date keyExpirationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyExpirationTime(boolean isCritical, long secondsFromCreationToExpiration);
|
||||
SelfSignatureSubpackets setKeyExpirationTime(boolean isCritical, long secondsFromCreationToExpiration);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyExpirationTime(@Nullable KeyExpirationTime keyExpirationTime);
|
||||
SelfSignatureSubpackets setKeyExpirationTime(@Nullable KeyExpirationTime keyExpirationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredCompressionAlgorithms(CompressionAlgorithm... algorithms);
|
||||
SelfSignatureSubpackets setPreferredCompressionAlgorithms(CompressionAlgorithm... algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredCompressionAlgorithms(Set<CompressionAlgorithm> algorithms);
|
||||
SelfSignatureSubpackets setPreferredCompressionAlgorithms(Set<CompressionAlgorithm> algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredCompressionAlgorithms(boolean isCritical, Set<CompressionAlgorithm> algorithms);
|
||||
SelfSignatureSubpackets setPreferredCompressionAlgorithms(boolean isCritical, Set<CompressionAlgorithm> algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredCompressionAlgorithms(@Nullable PreferredAlgorithms algorithms);
|
||||
SelfSignatureSubpackets setPreferredCompressionAlgorithms(@Nullable PreferredAlgorithms algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredSymmetricKeyAlgorithms(SymmetricKeyAlgorithm... algorithms);
|
||||
SelfSignatureSubpackets setPreferredSymmetricKeyAlgorithms(SymmetricKeyAlgorithm... algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredSymmetricKeyAlgorithms(Set<SymmetricKeyAlgorithm> algorithms);
|
||||
SelfSignatureSubpackets setPreferredSymmetricKeyAlgorithms(Set<SymmetricKeyAlgorithm> algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredSymmetricKeyAlgorithms(boolean isCritical, Set<SymmetricKeyAlgorithm> algorithms);
|
||||
SelfSignatureSubpackets setPreferredSymmetricKeyAlgorithms(boolean isCritical, Set<SymmetricKeyAlgorithm> algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredSymmetricKeyAlgorithms(@Nullable PreferredAlgorithms algorithms);
|
||||
SelfSignatureSubpackets setPreferredSymmetricKeyAlgorithms(@Nullable PreferredAlgorithms algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredHashAlgorithms(HashAlgorithm... algorithms);
|
||||
SelfSignatureSubpackets setPreferredHashAlgorithms(HashAlgorithm... algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredHashAlgorithms(Set<HashAlgorithm> algorithms);
|
||||
SelfSignatureSubpackets setPreferredHashAlgorithms(Set<HashAlgorithm> algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredHashAlgorithms(boolean isCritical, Set<HashAlgorithm> algorithms);
|
||||
SelfSignatureSubpackets setPreferredHashAlgorithms(boolean isCritical, Set<HashAlgorithm> algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredHashAlgorithms(@Nullable PreferredAlgorithms algorithms);
|
||||
SelfSignatureSubpackets setPreferredHashAlgorithms(@Nullable PreferredAlgorithms algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addRevocationKey(@Nonnull PGPPublicKey revocationKey);
|
||||
SelfSignatureSubpackets addRevocationKey(@Nonnull PGPPublicKey revocationKey);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addRevocationKey(boolean isCritical, @Nonnull PGPPublicKey revocationKey);
|
||||
SelfSignatureSubpackets addRevocationKey(boolean isCritical, @Nonnull PGPPublicKey revocationKey);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addRevocationKey(boolean isCritical, boolean isSensitive, @Nonnull PGPPublicKey revocationKey);
|
||||
SelfSignatureSubpackets addRevocationKey(boolean isCritical, boolean isSensitive, @Nonnull PGPPublicKey revocationKey);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addRevocationKey(@Nonnull RevocationKey revocationKey);
|
||||
SelfSignatureSubpackets addRevocationKey(@Nonnull RevocationKey revocationKey);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper clearRevocationKeys();
|
||||
SelfSignatureSubpackets clearRevocationKeys();
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setFeatures(Feature... features);
|
||||
SelfSignatureSubpackets setFeatures(Feature... features);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setFeatures(boolean isCritical, Feature... features);
|
||||
SelfSignatureSubpackets setFeatures(boolean isCritical, Feature... features);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setFeatures(@Nullable Features features);
|
||||
SelfSignatureSubpackets setFeatures(@Nullable Features features);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.signature.subpackets;
|
||||
|
||||
public interface SignatureSubpacketCallback<S extends BaseSignatureSubpackets> {
|
||||
|
||||
/**
|
||||
* Callback method that can be used to modify the hashed subpackets of a signature.
|
||||
*
|
||||
* @param hashedSubpackets hashed subpackets
|
||||
*/
|
||||
default void modifyHashedSubpackets(S hashedSubpackets) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback method that can be used to modify the unhashed subpackets of a signature.
|
||||
*
|
||||
* @param unhashedSubpackets unhashed subpackets
|
||||
*/
|
||||
default void modifyUnhashedSubpackets(S unhashedSubpackets) {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue