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) {
|
||||
BaseSignatureSubpackets setIssuerFingerprintAndKeyId(PGPPublicKey key);
|
||||
|
||||
}
|
||||
}
|
||||
BaseSignatureSubpackets setIssuerKeyId(long keyId);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setIssuerFingerprintAndKeyId(PGPPublicKey key);
|
||||
BaseSignatureSubpackets setIssuerKeyId(boolean isCritical, long keyId);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setIssuerKeyId(long keyId);
|
||||
BaseSignatureSubpackets setIssuerKeyId(@Nullable IssuerKeyID issuerKeyID);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setIssuerKeyId(boolean isCritical, long keyId);
|
||||
BaseSignatureSubpackets setIssuerFingerprint(@Nonnull PGPPublicKey key);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setIssuerKeyId(@Nullable IssuerKeyID issuerKeyID);
|
||||
BaseSignatureSubpackets setIssuerFingerprint(boolean isCritical, @Nonnull PGPPublicKey key);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setIssuerFingerprint(@Nonnull PGPPublicKey key);
|
||||
BaseSignatureSubpackets setIssuerFingerprint(@Nullable IssuerFingerprint fingerprint);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setIssuerFingerprint(boolean isCritical, @Nonnull PGPPublicKey key);
|
||||
BaseSignatureSubpackets setSignatureCreationTime(@Nonnull Date creationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setIssuerFingerprint(@Nullable IssuerFingerprint fingerprint);
|
||||
BaseSignatureSubpackets setSignatureCreationTime(boolean isCritical, @Nonnull Date creationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureCreationTime(@Nonnull Date creationTime);
|
||||
BaseSignatureSubpackets setSignatureCreationTime(@Nullable SignatureCreationTime signatureCreationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureCreationTime(boolean isCritical, @Nonnull Date creationTime);
|
||||
BaseSignatureSubpackets setSignatureExpirationTime(@Nonnull Date creationTime, @Nonnull Date expirationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureCreationTime(@Nullable SignatureCreationTime signatureCreationTime);
|
||||
BaseSignatureSubpackets setSignatureExpirationTime(boolean isCritical, @Nonnull Date creationTime, @Nonnull Date expirationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureExpirationTime(@Nonnull Date creationTime, @Nonnull Date expirationTime);
|
||||
BaseSignatureSubpackets setSignatureExpirationTime(boolean isCritical, long seconds);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureExpirationTime(boolean isCritical, @Nonnull Date creationTime, @Nonnull Date expirationTime);
|
||||
BaseSignatureSubpackets setSignatureExpirationTime(@Nullable SignatureExpirationTime expirationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureExpirationTime(boolean isCritical, long seconds);
|
||||
BaseSignatureSubpackets setSignerUserId(@Nonnull String userId);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureExpirationTime(@Nullable SignatureExpirationTime expirationTime);
|
||||
BaseSignatureSubpackets setSignerUserId(boolean isCritical, @Nonnull String userId);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignerUserId(@Nonnull String userId);
|
||||
BaseSignatureSubpackets setSignerUserId(@Nullable SignerUserID signerUserId);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignerUserId(boolean isCritical, @Nonnull String userId);
|
||||
BaseSignatureSubpackets addNotationData(boolean isCritical, @Nonnull String notationName, @Nonnull String notationValue);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignerUserId(@Nullable SignerUserID signerUserId);
|
||||
BaseSignatureSubpackets addNotationData(boolean isCritical, boolean isHumanReadable, @Nonnull String notationName, @Nonnull String notationValue);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addNotationData(boolean isCritical, @Nonnull String notationName, @Nonnull String notationValue);
|
||||
BaseSignatureSubpackets addNotationData(@Nonnull NotationData notationData);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addNotationData(boolean isCritical, boolean isHumanReadable, @Nonnull String notationName, @Nonnull String notationValue);
|
||||
BaseSignatureSubpackets clearNotationData();
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addNotationData(@Nonnull NotationData notationData);
|
||||
BaseSignatureSubpackets addIntendedRecipientFingerprint(@Nonnull PGPPublicKey recipient);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper clearNotationData();
|
||||
BaseSignatureSubpackets addIntendedRecipientFingerprint(boolean isCritical, @Nonnull PGPPublicKey recipient);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addIntendedRecipientFingerprint(@Nonnull PGPPublicKey recipient);
|
||||
BaseSignatureSubpackets addIntendedRecipientFingerprint(IntendedRecipientFingerprint intendedRecipientFingerprint);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addIntendedRecipientFingerprint(boolean isCritical, @Nonnull PGPPublicKey recipient);
|
||||
BaseSignatureSubpackets clearIntendedRecipientFingerprints();
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addIntendedRecipientFingerprint(IntendedRecipientFingerprint intendedRecipientFingerprint);
|
||||
BaseSignatureSubpackets setExportable(boolean isCritical, boolean isExportable);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper clearIntendedRecipientFingerprints();
|
||||
BaseSignatureSubpackets setExportable(@Nullable Exportable exportable);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setExportable(boolean isCritical, boolean isExportable);
|
||||
BaseSignatureSubpackets setRevocable(boolean isCritical, boolean isRevocable);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setExportable(@Nullable Exportable exportable);
|
||||
BaseSignatureSubpackets setRevocable(@Nullable Revocable revocable);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setRevocable(boolean isCritical, boolean isRevocable);
|
||||
BaseSignatureSubpackets setSignatureTarget(@Nonnull PublicKeyAlgorithm keyAlgorithm, @Nonnull HashAlgorithm hashAlgorithm, @Nonnull byte[] hashData);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setRevocable(@Nullable Revocable revocable);
|
||||
BaseSignatureSubpackets setSignatureTarget(boolean isCritical, @Nonnull PublicKeyAlgorithm keyAlgorithm, @Nonnull HashAlgorithm hashAlgorithm, @Nonnull byte[] hashData);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureTarget(@Nonnull PublicKeyAlgorithm keyAlgorithm, @Nonnull HashAlgorithm hashAlgorithm, @Nonnull byte[] hashData);
|
||||
BaseSignatureSubpackets setSignatureTarget(@Nullable SignatureTarget signatureTarget);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureTarget(boolean isCritical, @Nonnull PublicKeyAlgorithm keyAlgorithm, @Nonnull HashAlgorithm hashAlgorithm, @Nonnull byte[] hashData);
|
||||
BaseSignatureSubpackets setTrust(int depth, int amount);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setSignatureTarget(@Nullable SignatureTarget signatureTarget);
|
||||
BaseSignatureSubpackets setTrust(boolean isCritical, int depth, int amount);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setTrust(int depth, int amount);
|
||||
BaseSignatureSubpackets setTrust(@Nullable TrustSignature trust);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setTrust(boolean isCritical, int depth, int amount);
|
||||
BaseSignatureSubpackets addEmbeddedSignature(@Nonnull PGPSignature signature) throws IOException;
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setTrust(@Nullable TrustSignature trust);
|
||||
BaseSignatureSubpackets addEmbeddedSignature(boolean isCritical, @Nonnull PGPSignature signature) throws IOException;
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addEmbeddedSignature(@Nonnull PGPSignature signature) throws IOException;
|
||||
BaseSignatureSubpackets addEmbeddedSignature(@Nonnull EmbeddedSignature embeddedSignature);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addEmbeddedSignature(boolean isCritical, @Nonnull PGPSignature signature) throws IOException;
|
||||
|
||||
SignatureSubpacketGeneratorWrapper 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) {
|
||||
RevocationSignatureSubpackets setRevocationReason(RevocationAttributes revocationAttributes);
|
||||
|
||||
}
|
||||
}
|
||||
RevocationSignatureSubpackets setRevocationReason(boolean isCritical, RevocationAttributes revocationAttributes);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setRevocationReason(RevocationAttributes revocationAttributes);
|
||||
RevocationSignatureSubpackets setRevocationReason(boolean isCritical, RevocationAttributes.Reason reason, @Nonnull String description);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setRevocationReason(boolean isCritical, RevocationAttributes revocationAttributes);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper 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) {
|
||||
SelfSignatureSubpackets setKeyFlags(KeyFlag... keyFlags);
|
||||
|
||||
}
|
||||
}
|
||||
SelfSignatureSubpackets setKeyFlags(boolean isCritical, KeyFlag... keyFlags);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyFlags(KeyFlag... keyFlags);
|
||||
SelfSignatureSubpackets setKeyFlags(@Nullable KeyFlags keyFlags);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyFlags(boolean isCritical, KeyFlag... keyFlags);
|
||||
SelfSignatureSubpackets setPrimaryUserId();
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyFlags(@Nullable KeyFlags keyFlags);
|
||||
SelfSignatureSubpackets setPrimaryUserId(boolean isCritical);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPrimaryUserId();
|
||||
SelfSignatureSubpackets setPrimaryUserId(@Nullable PrimaryUserID primaryUserId);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPrimaryUserId(boolean isCritical);
|
||||
SelfSignatureSubpackets setKeyExpirationTime(@Nonnull PGPPublicKey key, @Nonnull Date keyExpirationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPrimaryUserId(@Nullable PrimaryUserID primaryUserId);
|
||||
SelfSignatureSubpackets setKeyExpirationTime(@Nonnull Date keyCreationTime, @Nonnull Date keyExpirationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyExpirationTime(@Nonnull PGPPublicKey key, @Nonnull Date keyExpirationTime);
|
||||
SelfSignatureSubpackets setKeyExpirationTime(boolean isCritical, @Nonnull Date keyCreationTime, @Nonnull Date keyExpirationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyExpirationTime(@Nonnull Date keyCreationTime, @Nonnull Date keyExpirationTime);
|
||||
SelfSignatureSubpackets setKeyExpirationTime(boolean isCritical, long secondsFromCreationToExpiration);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyExpirationTime(boolean isCritical, @Nonnull Date keyCreationTime, @Nonnull Date keyExpirationTime);
|
||||
SelfSignatureSubpackets setKeyExpirationTime(@Nullable KeyExpirationTime keyExpirationTime);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyExpirationTime(boolean isCritical, long secondsFromCreationToExpiration);
|
||||
SelfSignatureSubpackets setPreferredCompressionAlgorithms(CompressionAlgorithm... algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setKeyExpirationTime(@Nullable KeyExpirationTime keyExpirationTime);
|
||||
SelfSignatureSubpackets setPreferredCompressionAlgorithms(Set<CompressionAlgorithm> algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredCompressionAlgorithms(CompressionAlgorithm... algorithms);
|
||||
SelfSignatureSubpackets setPreferredCompressionAlgorithms(boolean isCritical, Set<CompressionAlgorithm> algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredCompressionAlgorithms(Set<CompressionAlgorithm> algorithms);
|
||||
SelfSignatureSubpackets setPreferredCompressionAlgorithms(@Nullable PreferredAlgorithms algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredCompressionAlgorithms(boolean isCritical, Set<CompressionAlgorithm> algorithms);
|
||||
SelfSignatureSubpackets setPreferredSymmetricKeyAlgorithms(SymmetricKeyAlgorithm... algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredCompressionAlgorithms(@Nullable PreferredAlgorithms algorithms);
|
||||
SelfSignatureSubpackets setPreferredSymmetricKeyAlgorithms(Set<SymmetricKeyAlgorithm> algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredSymmetricKeyAlgorithms(SymmetricKeyAlgorithm... algorithms);
|
||||
SelfSignatureSubpackets setPreferredSymmetricKeyAlgorithms(boolean isCritical, Set<SymmetricKeyAlgorithm> algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredSymmetricKeyAlgorithms(Set<SymmetricKeyAlgorithm> algorithms);
|
||||
SelfSignatureSubpackets setPreferredSymmetricKeyAlgorithms(@Nullable PreferredAlgorithms algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredSymmetricKeyAlgorithms(boolean isCritical, Set<SymmetricKeyAlgorithm> algorithms);
|
||||
SelfSignatureSubpackets setPreferredHashAlgorithms(HashAlgorithm... algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredSymmetricKeyAlgorithms(@Nullable PreferredAlgorithms algorithms);
|
||||
SelfSignatureSubpackets setPreferredHashAlgorithms(Set<HashAlgorithm> algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredHashAlgorithms(HashAlgorithm... algorithms);
|
||||
SelfSignatureSubpackets setPreferredHashAlgorithms(boolean isCritical, Set<HashAlgorithm> algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredHashAlgorithms(Set<HashAlgorithm> algorithms);
|
||||
SelfSignatureSubpackets setPreferredHashAlgorithms(@Nullable PreferredAlgorithms algorithms);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredHashAlgorithms(boolean isCritical, Set<HashAlgorithm> algorithms);
|
||||
SelfSignatureSubpackets addRevocationKey(@Nonnull PGPPublicKey revocationKey);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setPreferredHashAlgorithms(@Nullable PreferredAlgorithms algorithms);
|
||||
SelfSignatureSubpackets addRevocationKey(boolean isCritical, @Nonnull PGPPublicKey revocationKey);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addRevocationKey(@Nonnull PGPPublicKey revocationKey);
|
||||
SelfSignatureSubpackets addRevocationKey(boolean isCritical, boolean isSensitive, @Nonnull PGPPublicKey revocationKey);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addRevocationKey(boolean isCritical, @Nonnull PGPPublicKey revocationKey);
|
||||
SelfSignatureSubpackets addRevocationKey(@Nonnull RevocationKey revocationKey);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addRevocationKey(boolean isCritical, boolean isSensitive, @Nonnull PGPPublicKey revocationKey);
|
||||
SelfSignatureSubpackets clearRevocationKeys();
|
||||
|
||||
SignatureSubpacketGeneratorWrapper addRevocationKey(@Nonnull RevocationKey revocationKey);
|
||||
SelfSignatureSubpackets setFeatures(Feature... features);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper clearRevocationKeys();
|
||||
SelfSignatureSubpackets setFeatures(boolean isCritical, Feature... features);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper setFeatures(Feature... features);
|
||||
|
||||
SignatureSubpacketGeneratorWrapper 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