Top Description Fields Constructors Methods
org.bouncycastle.openpgp

public Class PGPSignatureSubpacketGenerator

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.ArrayList, .Arrays, .Date, .List, org.bouncycastle.bcpg.SignatureSubpacket, .SignatureSubpacketTags, org.bouncycastle.bcpg.sig.EmbeddedSignature, .Exportable, .Features, .IntendedRecipientFingerprint, .IssuerFingerprint, .IssuerKeyID, .KeyExpirationTime, .KeyFlags, .LibrePGPPreferredEncryptionModes, .NotationData, .PolicyURI, .PreferredAEADCiphersuites, .PreferredAlgorithms, .PreferredKeyServer, .PrimaryUserID, .RegularExpression, .Revocable, .RevocationKey, .RevocationKeyTags, .RevocationReason, .SignatureCreationTime, .SignatureExpirationTime, .SignatureTarget, .SignerUserID, .TrustSignature

Generator for signature subpackets.

Field Summary

Modifier and TypeField and Description
pack-priv List<SignatureSubpacket>

Constructor Summary

AccessConstructor and Description
public
PGPSignatureSubpacketGenerator()

Base constructor, creates an empty generator.

public
PGPSignatureSubpacketGenerator(PGPSignatureSubpacketVector
an initial set of subpackets.
sigSubV
)

Constructor for pre-initialising the generator from an existing one.

Method Summary

Modifier and TypeMethod and Description
public void
addCustomSubpacket(SignatureSubpacket
subpacket
subpacket
)

Add a custom subpacket.

public void
addEmbeddedSignature(boolean
true if should be treated as critical, false otherwise.
isCritical
,
PGPSignature
embedded signature
pgpSignature
)

Add an embedded signature packet.

public void
addIntendedRecipientFingerprint(PGPPublicKey
the public key the encrypted payload was encrypted against.
publicKey
)

Adds a intended recipient fingerprint for an encrypted payload the signature is associated with.

public void
addIntendedRecipientFingerprint(boolean
true if critical, false otherwise.
isCritical
,
PGPPublicKey
the public key the encrypted payload was encrypted against.
publicKey
)

Adds a intended recipient fingerprint for an encrypted payload the signature is associated with.

public void
addNotationData(boolean
true if should be treated as critical, false otherwise.
isCritical
,
boolean
true if the notation is human-readable.
isHumanReadable
,
String
name of the notation key.
notationName
,
String
value of the notation.
notationValue
)

Add a notation data packet to the signature.

public void
addPolicyURI(boolean isCritical, String policyUri)

public void
addRegularExpression(String
the regular expression
regularExpression
)

Adds a regular expression.

public void
addRegularExpression(boolean
true if should be treated as critical, false otherwise.
isCritical
,
String
the regular expression
regularExpression
)

Adds a regular expression.

public void
addRevocationKey(boolean
true if should be treated as critical, false otherwise.
isCritical
,
int
algorithm of the revocation key
keyAlgorithm
,
byte[]
fingerprint of the revocation key (v4 only)
fingerprint
)
Deprecated the revocation key mechanism is deprecated. Applications MUST NOT generate such a packet.

Adds a revocation key sub packet.

public void
addSignerUserID(boolean
true if should be treated as critical, false otherwise.
isCritical
,
String
signer user-id
userID
)

Add a signer user-id to the signature.

public void
addSignerUserID(boolean
true if should be treated as critical, false otherwise.
isCritical
,
byte[]
signer user-id
rawUserID
)

Add a signer user-id to the signature.

private boolean
contains(int type)

public PGPSignatureSubpacketVector
public SignatureSubpacket[]

Returns:

an array of zero or more matching subpackets.
getSubpackets
(int
subpacket type code
type
)

Return all signature subpackets of the passed in type currently in the generator.

public boolean

Returns:

true if present, false otherwise.
hasSubpacket
(int
type to look for.
type
)

Return true if a particular subpacket type exists.

public boolean
removePacket(SignatureSubpacket
the signature subpacket to remove.
packet
)

Remove a previously set packet from the generator.

public boolean

Returns:

true if any packet was removed, false otherwise
removePacketsOfType
(int
type to remove
subpacketType
)

Remove all SignatureSubpacket objects of the given subpacketType from the underlying subpacket vector.

public void
setEmbeddedSignature(boolean
true if should be treated as critical, false otherwise.
isCritical
,
PGPSignature
embedded signature
pgpSignature
)

Add an embedded signature packet.

public void
setExportable(boolean
true if the signature should be exportable, false otherwise.
isExportable
)

Specify, whether the signature should be marked as exportable.

public void
setExportable(boolean
true if should be treated as critical, false otherwise.
isCritical
,
boolean
true if the signature should be exportable, false otherwise.
isExportable
)

Specify, whether or not the signature should be marked as exportable.

public void
setFeature(boolean
true if should be treated as critical, false otherwise.
isCritical
,
byte
features
feature
)

Specify the set of features of the key.

public void
setIntendedRecipientFingerprint(boolean
true if critical, false otherwise.
isCritical
,
PGPPublicKey
the public key the encrypted payload was encrypted against.
publicKey
)

Adds a intended recipient fingerprint for an encrypted payload the signature is associated with.

public void
setIssuerFingerprint(boolean
true if critical, false otherwise.
isCritical
,
PGPSecretKey
the secret key used to generate the associated signature.
secretKey
)

Sets the signature issuer fingerprint for the signing key.

public void
setIssuerFingerprint(boolean
true if critical, false otherwise.
isCritical
,
PGPPublicKey
the public key needed to verify the associated signature.
publicKey
)

Sets the signature issuer fingerprint for the signing key.

public void
setIssuerKeyID(boolean
true if should be treated as critical, false otherwise.
isCritical
,
long
id of the key that issued the signature
keyID
)

Sets issuer key-id subpacket.

public void
setKeyExpirationTime(long
seconds from key creation to expiration
seconds
)

Set the number of seconds a key is valid for after the time of its creation.

public void
setKeyExpirationTime(boolean
true if should be treated as critical, false otherwise.
isCritical
,
long seconds)

Set the number of seconds a key is valid for after the time of its creation.

public void
setKeyFlags(int
flags
flags
)

Set this keys key flags.

public void
setKeyFlags(boolean
true if should be treated as critical, false otherwise.
isCritical
,
int
flags
flags
)

Set this keys key flags.

public void
setNotationData(boolean
true if should be treated as critical, false otherwise.
isCritical
,
boolean
true if the notation is human-readable.
isHumanReadable
,
String
name of the notation key
notationName
,
String
value of the notation
notationValue
)

Add a notation data packet to the signature.

public void
setPreferredAEADAlgorithms(boolean
true if should be treated as critical, false otherwise.
isCritical
,
int[]
array of algorithms in descending preference
algorithms
)

This method is BROKEN!

public void
setPreferredAEADCiphersuites(boolean
true, if this packet should be treated as critical, false otherwise.
isCritical
,
PreferredAEADCiphersuites.Combination[]
array of algorithms in descending preference
algorithms
)

Specify the preferred OpenPGP AEAD ciphersuites of this key.

public void
setPreferredAEADCiphersuites(PreferredAEADCiphersuites.Builder
builder to build the ciphersuites packet from
builder
)

Specify the preferred OpenPGP AEAD ciphersuites of this key.

public void
setPreferredCompressionAlgorithms(boolean
true if should be treated as critical, false otherwise.
isCritical
,
int[]
array of algorithms in descending preference
algorithms
)

Specify the preferred compression algorithms of this key.

public void
setPreferredHashAlgorithms(boolean
true if should be treated as critical, false otherwise.
isCritical
,
int[]
array of algorithms in descending preference
algorithms
)

Specify the preferred hash algorithms of the key.

public void
setPreferredKeyServer(boolean
true if the subpacket should be treated as critical
isCritical
,
String
key server URI
uri
)

Specify the preferred key server for the signed user-id / key.

public void
setPreferredLibrePgpEncryptionModes(boolean
whether the packet is critical
isCritical
,
int[]
list of algorithms
algorithms
)
Deprecated the use of this subpacket is deprecated in LibrePGP

Set the preferred encryption modes for LibrePGP keys.

public void
setPreferredSymmetricAlgorithms(boolean
true if should be treated as critical, false otherwise.
isCritical
,
int[]
array of algorithms in descending preference
algorithms
)

Specify the preferred symmetric encryption algorithms of the key.

public void
setPrimaryUserID(boolean isCritical, boolean isPrimaryUserID)

public void
setRevocable(boolean
true if should be treated as critical, false otherwise.
isCritical
,
boolean
true if the signature should be revocable, false otherwise.
isRevocable
)

Specify, whether or not the signature is revocable.

public void
setRevocationKey(boolean
true if should be treated as critical, false otherwise.
isCritical
,
int
algorithm of the revocation key
keyAlgorithm
,
byte[]
fingerprint of the revocation key (v4 only)
fingerprint
)
Deprecated the revocation key mechanism is deprecated. Applications MUST NOT generate such a packet.

Adds a revocation key sub packet.

public void
setRevocationReason(boolean
true if should be treated as critical, false otherwise.
isCritical
,
byte
reason code for the revocation
reason
,
String
human readable description of the revocation reason
description
)

Sets revocation reason sub packet.

public void
setSignatureCreationTime(Date
date
date
)

Set the creation time for the signature.

public void
setSignatureCreationTime(boolean isCritical, Date date)

Set the creation time for the signature.

public void
setSignatureExpirationTime(long
seconds from signature creation to expiration
seconds
)

Set the number of seconds a signature is valid for after the time of its creation.

public void
setSignatureExpirationTime(boolean
true if should be treated as critical, false otherwise.
isCritical
,
long seconds)

Set the number of seconds a signature is valid for after the time of its creation.

public void
setSignatureTarget(boolean
true if should be treated as critical, false otherwise.
isCritical
,
int
algorithm of the key that issued the signature that is being referred to.
publicKeyAlgorithm
,
int
hash algorithm that was used to calculate the hash data.
hashAlgorithm
,
byte[]
hash of the signature that is being referred to.
hashData
)

Sets the signature target sub packet.

public void
setSignerUserID(boolean
true if should be treated as critical, false otherwise.
isCritical
,
String
signer user-id
userID
)
Deprecated use addSignerUserID(boolean, String) instead.

Add a signer user-id to the signature.

public void
setSignerUserID(boolean
true if should be treated as critical, false otherwise.
isCritical
,
byte[]
signer user-id
rawUserID
)
Deprecated use addSignerUserID(boolean, byte[]) instead.

Add a signer user-id to the signature.

public void
setTrust(boolean
true if the packet is critical.
isCritical
,
int
depth level.
depth
,
int
trust amount.
trustAmount
)

Add a TrustSignature packet to the signature.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

packetsback to summary
pack-priv List<SignatureSubpacket> packets

Constructor Detail

PGPSignatureSubpacketGeneratorback to summary
public PGPSignatureSubpacketGenerator()

Base constructor, creates an empty generator.

PGPSignatureSubpacketGeneratorback to summary
public PGPSignatureSubpacketGenerator(PGPSignatureSubpacketVector sigSubV)

Constructor for pre-initialising the generator from an existing one.

Parameters
sigSubV:PGPSignatureSubpacketVector

an initial set of subpackets.

Method Detail

addCustomSubpacketback to summary
public void addCustomSubpacket(SignatureSubpacket subpacket)

Add a custom subpacket. Miscellaneous subpackets are subpackets that Bouncycastle does not recognize or doesn't have first class support for.

Parameters
subpacket:SignatureSubpacket

subpacket

addEmbeddedSignatureback to summary
public void addEmbeddedSignature(boolean isCritical, PGPSignature pgpSignature) throws IOException

Add an embedded signature packet.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

pgpSignature:PGPSignature

embedded signature

Exceptions
IOException:
in case of an error
addIntendedRecipientFingerprintback to summary
public void addIntendedRecipientFingerprint(PGPPublicKey publicKey)

Adds a intended recipient fingerprint for an encrypted payload the signature is associated with. The subpacket will be marked as critical, as is recommended by the spec.

Parameters
publicKey:PGPPublicKey

the public key the encrypted payload was encrypted against.

addIntendedRecipientFingerprintback to summary
public void addIntendedRecipientFingerprint(boolean isCritical, PGPPublicKey publicKey)

Adds a intended recipient fingerprint for an encrypted payload the signature is associated with.

Parameters
isCritical:boolean

true if critical, false otherwise.

publicKey:PGPPublicKey

the public key the encrypted payload was encrypted against.

addNotationDataback to summary
public void addNotationData(boolean isCritical, boolean isHumanReadable, String notationName, String notationValue)

Add a notation data packet to the signature.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

isHumanReadable:boolean

true if the notation is human-readable.

notationName:String

name of the notation key.

notationValue:String

value of the notation.

addPolicyURIback to summary
public void addPolicyURI(boolean isCritical, String policyUri)
addRegularExpressionback to summary
public void addRegularExpression(String regularExpression)

Adds a regular expression. The subpacket is marked as critical, as is recommended by the spec.

Parameters
regularExpression:String

the regular expression

addRegularExpressionback to summary
public void addRegularExpression(boolean isCritical, String regularExpression)

Adds a regular expression.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

regularExpression:String

the regular expression

addRevocationKeyback to summary
public void addRevocationKey(boolean isCritical, int keyAlgorithm, byte[] fingerprint)

Deprecated

the revocation key mechanism is deprecated. Applications MUST NOT generate such a packet.

Adds a revocation key sub packet.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

keyAlgorithm:int

algorithm of the revocation key

fingerprint:byte[]

fingerprint of the revocation key (v4 only)

addSignerUserIDback to summary
public void addSignerUserID(boolean isCritical, String userID)

Add a signer user-id to the signature.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

userID:String

signer user-id

addSignerUserIDback to summary
public void addSignerUserID(boolean isCritical, byte[] rawUserID)

Add a signer user-id to the signature.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

rawUserID:byte[]

signer user-id

containsback to summary
private boolean contains(int type)
generateback to summary
public PGPSignatureSubpacketVector generate()
getSubpacketsback to summary
public SignatureSubpacket[] getSubpackets(int type)

Return all signature subpackets of the passed in type currently in the generator.

Parameters
type:int

subpacket type code

Returns:SignatureSubpacket[]

an array of zero or more matching subpackets.

hasSubpacketback to summary
public boolean hasSubpacket(int type)

Return true if a particular subpacket type exists.

Parameters
type:int

type to look for.

Returns:boolean

true if present, false otherwise.

removePacketback to summary
public boolean removePacket(SignatureSubpacket packet)

Remove a previously set packet from the generator.

Parameters
packet:SignatureSubpacket

the signature subpacket to remove.

removePacketsOfTypeback to summary
public boolean removePacketsOfType(int subpacketType)

Remove all SignatureSubpacket objects of the given subpacketType from the underlying subpacket vector.

Parameters
subpacketType:int

type to remove

Returns:boolean

true if any packet was removed, false otherwise

setEmbeddedSignatureback to summary
public void setEmbeddedSignature(boolean isCritical, PGPSignature pgpSignature) throws IOException

Add an embedded signature packet.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

pgpSignature:PGPSignature

embedded signature

Exceptions
IOException:
in case of an error
setExportableback to summary
public void setExportable(boolean isExportable)

Specify, whether the signature should be marked as exportable. If this subpacket is missing, the signature is treated as being exportable. The subpacket is marked as critical, as is required (for non-exportable signatures) by the spec.

Parameters
isExportable:boolean

true if the signature should be exportable, false otherwise.

setExportableback to summary
public void setExportable(boolean isCritical, boolean isExportable)

Specify, whether or not the signature should be marked as exportable. If this subpacket is missing, the signature is treated as being exportable.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

isExportable:boolean

true if the signature should be exportable, false otherwise.

setFeatureback to summary
public void setFeature(boolean isCritical, byte feature)

Specify the set of features of the key.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

feature:byte

features

setIntendedRecipientFingerprintback to summary
public void setIntendedRecipientFingerprint(boolean isCritical, PGPPublicKey publicKey)

Adds a intended recipient fingerprint for an encrypted payload the signature is associated with.

Parameters
isCritical:boolean

true if critical, false otherwise.

publicKey:PGPPublicKey

the public key the encrypted payload was encrypted against.

setIssuerFingerprintback to summary
public void setIssuerFingerprint(boolean isCritical, PGPSecretKey secretKey)

Sets the signature issuer fingerprint for the signing key.

Parameters
isCritical:boolean

true if critical, false otherwise.

secretKey:PGPSecretKey

the secret key used to generate the associated signature.

setIssuerFingerprintback to summary
public void setIssuerFingerprint(boolean isCritical, PGPPublicKey publicKey)

Sets the signature issuer fingerprint for the signing key.

Parameters
isCritical:boolean

true if critical, false otherwise.

publicKey:PGPPublicKey

the public key needed to verify the associated signature.

setIssuerKeyIDback to summary
public void setIssuerKeyID(boolean isCritical, long keyID)

Sets issuer key-id subpacket.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

keyID:long

id of the key that issued the signature

setKeyExpirationTimeback to summary
public void setKeyExpirationTime(long seconds)

Set the number of seconds a key is valid for after the time of its creation. A value of zero means the key never expires. The subpacket will be marked as critical, as is recommended by the spec.

Parameters
seconds:long

seconds from key creation to expiration

setKeyExpirationTimeback to summary
public void setKeyExpirationTime(boolean isCritical, long seconds)

Set the number of seconds a key is valid for after the time of its creation. A value of zero means the key never expires.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

setKeyFlagsback to summary
public void setKeyFlags(int flags)

Set this keys key flags. See PGPKeyFlags. The subpacket will be marked as critical, as is recommended by the spec.

Parameters
flags:int

flags

setKeyFlagsback to summary
public void setKeyFlags(boolean isCritical, int flags)

Set this keys key flags. See PGPKeyFlags.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

flags:int

flags

setNotationDataback to summary
public void setNotationData(boolean isCritical, boolean isHumanReadable, String notationName, String notationValue)

Add a notation data packet to the signature.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

isHumanReadable:boolean

true if the notation is human-readable.

notationName:String

name of the notation key

notationValue:String

value of the notation

setPreferredAEADAlgorithmsback to summary
public void setPreferredAEADAlgorithms(boolean isCritical, int[] algorithms)

This method is BROKEN! Specify the preferred AEAD algorithms of this key.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

algorithms:int[]

array of algorithms in descending preference

Annotations
@Deprecated
setPreferredAEADCiphersuitesback to summary
public void setPreferredAEADCiphersuites(boolean isCritical, PreferredAEADCiphersuites.Combination[] algorithms)

Specify the preferred OpenPGP AEAD ciphersuites of this key.

Parameters
isCritical:boolean

true, if this packet should be treated as critical, false otherwise.

algorithms:PreferredAEADCiphersuites.Combination[]

array of algorithms in descending preference

See Also
RFC9580: Preferred AEAD Ciphersuites
setPreferredAEADCiphersuitesback to summary
public void setPreferredAEADCiphersuites(PreferredAEADCiphersuites.Builder builder)

Specify the preferred OpenPGP AEAD ciphersuites of this key.

Parameters
builder:PreferredAEADCiphersuites.Builder

builder to build the ciphersuites packet from

See Also
RFC9580: Preferred AEAD Ciphersuites
setPreferredCompressionAlgorithmsback to summary
public void setPreferredCompressionAlgorithms(boolean isCritical, int[] algorithms)

Specify the preferred compression algorithms of this key. See org.bouncycastle.bcpg.CompressionAlgorithmTags.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

algorithms:int[]

array of algorithms in descending preference

setPreferredHashAlgorithmsback to summary
public void setPreferredHashAlgorithms(boolean isCritical, int[] algorithms)

Specify the preferred hash algorithms of the key. See org.bouncycastle.bcpg.HashAlgorithmTags.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

algorithms:int[]

array of algorithms in descending preference

setPreferredKeyServerback to summary
public void setPreferredKeyServer(boolean isCritical, String uri)

Specify the preferred key server for the signed user-id / key. Note, that the key server might also be a http/ftp etc. URI pointing to the key itself.

Parameters
isCritical:boolean

true if the subpacket should be treated as critical

uri:String

key server URI

setPreferredLibrePgpEncryptionModesback to summary
public void setPreferredLibrePgpEncryptionModes(boolean isCritical, int[] algorithms)

Deprecated

the use of this subpacket is deprecated in LibrePGP

Set the preferred encryption modes for LibrePGP keys.

Note

LibrePGP is not OpenPGP. An application strictly compliant to only the OpenPGP standard will not know how to handle LibrePGP encryption modes. The LibrePGP spec states that this subpacket shall be ignored and the application shall instead assume org.bouncycastle.bcpg.AEADAlgorithmTags#OCB.

Parameters
isCritical:boolean

whether the packet is critical

algorithms:int[]

list of algorithms

Annotations
@Deprecated
See Also
LibrePGP: Preferred Encryption Modes, {@link org.bouncycastle.bcpg.AEADAlgorithmTags} for possible algorithms
setPreferredSymmetricAlgorithmsback to summary
public void setPreferredSymmetricAlgorithms(boolean isCritical, int[] algorithms)

Specify the preferred symmetric encryption algorithms of the key. See org.bouncycastle.bcpg.SymmetricKeyAlgorithmTags.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

algorithms:int[]

array of algorithms in descending preference

setPrimaryUserIDback to summary
public void setPrimaryUserID(boolean isCritical, boolean isPrimaryUserID)
setRevocableback to summary
public void setRevocable(boolean isCritical, boolean isRevocable)

Specify, whether or not the signature is revocable.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

isRevocable:boolean

true if the signature should be revocable, false otherwise.

setRevocationKeyback to summary
public void setRevocationKey(boolean isCritical, int keyAlgorithm, byte[] fingerprint)

Deprecated

the revocation key mechanism is deprecated. Applications MUST NOT generate such a packet.

Adds a revocation key sub packet.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

keyAlgorithm:int

algorithm of the revocation key

fingerprint:byte[]

fingerprint of the revocation key (v4 only)

setRevocationReasonback to summary
public void setRevocationReason(boolean isCritical, byte reason, String description)

Sets revocation reason sub packet. See org.bouncycastle.bcpg.sig.RevocationReasonTags.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

reason:byte

reason code for the revocation

description:String

human readable description of the revocation reason

setSignatureCreationTimeback to summary
public void setSignatureCreationTime(Date date)

Set the creation time for the signature. The subpacket will be marked as critical, as is recommended by the spec.

Note

this overrides the generation of a creation time when the signature is generated.

Parameters
date:Date

date

setSignatureCreationTimeback to summary
public void setSignatureCreationTime(boolean isCritical, Date date)

Set the creation time for the signature.

Note

this overrides the generation of a creation time when the signature is generated.

setSignatureExpirationTimeback to summary
public void setSignatureExpirationTime(long seconds)

Set the number of seconds a signature is valid for after the time of its creation. A value of zero means the signature never expires. The subpacket will be marked as critical, as is recommended by the spec. .

Parameters
seconds:long

seconds from signature creation to expiration

setSignatureExpirationTimeback to summary
public void setSignatureExpirationTime(boolean isCritical, long seconds)

Set the number of seconds a signature is valid for after the time of its creation. A value of zero means the signature never expires.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

setSignatureTargetback to summary
public void setSignatureTarget(boolean isCritical, int publicKeyAlgorithm, int hashAlgorithm, byte[] hashData)

Sets the signature target sub packet.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

publicKeyAlgorithm:int

algorithm of the key that issued the signature that is being referred to.

hashAlgorithm:int

hash algorithm that was used to calculate the hash data.

hashData:byte[]

hash of the signature that is being referred to.

setSignerUserIDback to summary
public void setSignerUserID(boolean isCritical, String userID)

Deprecated

use addSignerUserID(boolean, String) instead.

Add a signer user-id to the signature.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

userID:String

signer user-id

setSignerUserIDback to summary
public void setSignerUserID(boolean isCritical, byte[] rawUserID)

Deprecated

use addSignerUserID(boolean, byte[]) instead.

Add a signer user-id to the signature.

Parameters
isCritical:boolean

true if should be treated as critical, false otherwise.

rawUserID:byte[]

signer user-id

setTrustback to summary
public void setTrust(boolean isCritical, int depth, int trustAmount)

Add a TrustSignature packet to the signature. The values for depth and trust are largely installation dependent but there are some guidelines in RFC 4880 - 5.2.3.13.

Parameters
isCritical:boolean

true if the packet is critical.

depth:int

depth level.

trustAmount:int

trust amount.