| Modifier and Type | Field and Description |
|---|---|
| pack-priv List |
| Access | Constructor and Description |
|---|---|
| public | |
| public | PGPSignatureSubpacketGenerator(PGPSignatureSubpacketVector
an initial set of subpackets. sigSubV)Constructor for pre-initialising the generator from an existing one. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| 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 | |
| public void | |
| 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 | |
| public PGPSignatureSubpacketVector | |
| public SignatureSubpacket[] | Returns: an array of zero or more matching subpackets.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.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 otherwisetype to remove subpacketType)Remove all |
| public void | setEmbeddedSignature(boolean
true if should be treated as critical, false otherwise. isCritical, PGPSignature embedded signature pgpSignature)
Deprecated
use
addEmbeddedSignature(boolean, PGPSignature) instead.
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)
Deprecated
use
addIntendedRecipientFingerprint(boolean, PGPPublicKey) instead.
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 | |
| 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)
Deprecated
use
addNotationData(boolean, boolean, String, String) instead.
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)
Deprecated
use
setPreferredAEADCiphersuites(boolean, PreferredAEADCiphersuites.
or setPreferredLibrePgpEncryptionModes(boolean, int[]) instead.
This method is BROKEN! |
| public void | setPreferredAEADCiphersuites(boolean
true, if this packet should be treated as critical, false otherwise. isCritical, PreferredAEADCiphersuites.array of algorithms in descending preference algorithmsSpecify the preferred OpenPGP AEAD ciphersuites of this key. |
| public void | setPreferredAEADCiphersuites(PreferredAEADCiphersuites.
builder to build the ciphersuites packet from builderSpecify 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 | |
| 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 | |
| public void | |
| 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. |
| packets | back to summary |
|---|---|
| pack-priv List<SignatureSubpacket> packets | |
| PGPSignatureSubpacketGenerator | back to summary |
|---|---|
| public PGPSignatureSubpacketGenerator() Base constructor, creates an empty generator. | |
| PGPSignatureSubpacketGenerator | back to summary |
|---|---|
| public PGPSignatureSubpacketGenerator(PGPSignatureSubpacketVector sigSubV) Constructor for pre-initialising the generator from an existing one.
| |
| addCustomSubpacket | back 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.
| |
| addEmbeddedSignature | back to summary |
|---|---|
| public void addEmbeddedSignature(boolean isCritical, PGPSignature pgpSignature) throws IOException Add an embedded signature packet.
| |
| addIntendedRecipientFingerprint | back 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.
| |
| addIntendedRecipientFingerprint | back to summary |
|---|---|
| public void addIntendedRecipientFingerprint(boolean isCritical, PGPPublicKey publicKey) Adds a intended recipient fingerprint for an encrypted payload the signature is associated with.
| |
| addNotationData | back to summary |
|---|---|
| public void addNotationData(boolean isCritical, boolean isHumanReadable, String notationName, String notationValue) Add a notation data packet to the signature. | |
| addPolicyURI | back to summary |
|---|---|
| public void addPolicyURI(boolean isCritical, String policyUri) | |
| addRegularExpression | back to summary |
|---|---|
| public void addRegularExpression(String regularExpression) Adds a regular expression. The subpacket is marked as critical, as is recommended by the spec.
| |
| addRegularExpression | back to summary |
|---|---|
| public void addRegularExpression(boolean isCritical, String regularExpression) Adds a regular expression.
| |
| addRevocationKey | back 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.
| |
| addSignerUserID | back to summary |
|---|---|
| public void addSignerUserID(boolean isCritical, String userID) Add a signer user-id to the signature.
| |
| addSignerUserID | back to summary |
|---|---|
| public void addSignerUserID(boolean isCritical, byte[] rawUserID) Add a signer user-id to the signature.
| |
| contains | back to summary |
|---|---|
| private boolean contains(int type) | |
| generate | back to summary |
|---|---|
| public PGPSignatureSubpacketVector generate() | |
| getSubpackets | back to summary |
|---|---|
| public SignatureSubpacket[] getSubpackets(int type) Return all signature subpackets of the passed in type currently in the generator.
| |
| hasSubpacket | back to summary |
|---|---|
| public boolean hasSubpacket(int type) Return true if a particular subpacket type exists.
| |
| removePacket | back to summary |
|---|---|
| public boolean removePacket(SignatureSubpacket packet) Remove a previously set packet from the generator.
| |
| removePacketsOfType | back to summary |
|---|---|
| public boolean removePacketsOfType(int subpacketType) Remove all
| |
| setEmbeddedSignature | back to summary |
|---|---|
| public void setEmbeddedSignature(boolean isCritical, PGPSignature pgpSignature) throws IOException
Deprecated use Add an embedded signature packet.
| |
| setExportable | back 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.
| |
| setExportable | back 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.
| |
| setFeature | back to summary |
|---|---|
| public void setFeature(boolean isCritical, byte feature) Specify the set of features of the key.
| |
| setIntendedRecipientFingerprint | back to summary |
|---|---|
| public void setIntendedRecipientFingerprint(boolean isCritical, PGPPublicKey publicKey)
Deprecated use Adds a intended recipient fingerprint for an encrypted payload the signature is associated with.
| |
| setIssuerFingerprint | back to summary |
|---|---|
| public void setIssuerFingerprint(boolean isCritical, PGPSecretKey secretKey) Sets the signature issuer fingerprint for the signing key.
| |
| setIssuerFingerprint | back to summary |
|---|---|
| public void setIssuerFingerprint(boolean isCritical, PGPPublicKey publicKey) Sets the signature issuer fingerprint for the signing key.
| |
| setIssuerKeyID | back to summary |
|---|---|
| public void setIssuerKeyID(boolean isCritical, long keyID) Sets issuer key-id subpacket.
| |
| setKeyExpirationTime | back 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.
| |
| setKeyExpirationTime | back 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.
| |
| setKeyFlags | back to summary |
|---|---|
| public void setKeyFlags(int flags) Set this keys key flags.
See
| |
| setKeyFlags | back to summary |
|---|---|
| public void setKeyFlags(boolean isCritical, int flags) Set this keys key flags.
See
| |
| setNotationData | back to summary |
|---|---|
| public void setNotationData(boolean isCritical, boolean isHumanReadable, String notationName, String notationValue)
Deprecated use Add a notation data packet to the signature. | |
| setPreferredAEADAlgorithms | back to summary |
|---|---|
| public void setPreferredAEADAlgorithms(boolean isCritical, int[] algorithms)
Deprecated use This method is BROKEN! Specify the preferred AEAD algorithms of this key.
| |
| setPreferredAEADCiphersuites | back to summary |
|---|---|
| public void setPreferredAEADCiphersuites(boolean isCritical, PreferredAEADCiphersuites. Specify the preferred OpenPGP AEAD ciphersuites of this key.
| |
| setPreferredAEADCiphersuites | back to summary |
|---|---|
| public void setPreferredAEADCiphersuites(PreferredAEADCiphersuites. Specify the preferred OpenPGP AEAD ciphersuites of this key.
| |
| setPreferredCompressionAlgorithms | back to summary |
|---|---|
| public void setPreferredCompressionAlgorithms(boolean isCritical, int[] algorithms) Specify the preferred compression algorithms of this key.
See
| |
| setPreferredHashAlgorithms | back to summary |
|---|---|
| public void setPreferredHashAlgorithms(boolean isCritical, int[] algorithms) Specify the preferred hash algorithms of the key.
See
| |
| setPreferredKeyServer | back 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.
| |
| setPreferredLibrePgpEncryptionModes | back 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
| |
| setPreferredSymmetricAlgorithms | back to summary |
|---|---|
| public void setPreferredSymmetricAlgorithms(boolean isCritical, int[] algorithms) Specify the preferred symmetric encryption algorithms of the key.
See
| |
| setPrimaryUserID | back to summary |
|---|---|
| public void setPrimaryUserID(boolean isCritical, boolean isPrimaryUserID) | |
| setRevocable | back to summary |
|---|---|
| public void setRevocable(boolean isCritical, boolean isRevocable) Specify, whether or not the signature is revocable.
| |
| setRevocationKey | back 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.
| |
| setRevocationReason | back to summary |
|---|---|
| public void setRevocationReason(boolean isCritical, byte reason, String description) Sets revocation reason sub packet.
See
| |
| setSignatureCreationTime | back 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.
| |
| setSignatureCreationTime | back 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. | |
| setSignatureExpirationTime | back 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. .
| |
| setSignatureExpirationTime | back 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.
| |
| setSignatureTarget | back to summary |
|---|---|
| public void setSignatureTarget(boolean isCritical, int publicKeyAlgorithm, int hashAlgorithm, byte[] hashData) Sets the signature target sub packet.
| |
| setSignerUserID | back to summary |
|---|---|
| public void setSignerUserID(boolean isCritical, String userID)
Deprecated use Add a signer user-id to the signature.
| |
| setSignerUserID | back to summary |
|---|---|
| public void setSignerUserID(boolean isCritical, byte[] rawUserID)
Deprecated use Add a signer user-id to the signature.
| |
| setTrust | back 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.
| |