Package org.bouncycastle.openpgp
Class PGPSignatureSubpacketGenerator
- java.lang.Object
-
- org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator
-
public class PGPSignatureSubpacketGenerator extends java.lang.ObjectGenerator for signature subpackets.
-
-
Constructor Summary
Constructors Constructor Description PGPSignatureSubpacketGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PGPSignatureSubpacketVectorgenerate()voidsetEmbeddedSignature(boolean isCritical, PGPSignature pgpSignature)voidsetExportable(boolean isCritical, boolean isExportable)voidsetFeature(boolean isCritical, byte feature)voidsetIntendedRecipientFingerprint(boolean isCritical, PGPPublicKey publicKey)Sets the intended recipient fingerprint for an encrypted payload the signature is associated with.voidsetIssuerFingerprint(boolean isCritical, PGPPublicKey publicKey)Sets the signature issuer fingerprint for the signing key.voidsetIssuerFingerprint(boolean isCritical, PGPSecretKey secretKey)Sets the signature issuer fingerprint for the signing key.voidsetIssuerKeyID(boolean isCritical, long keyID)Sets issuer key sub packetvoidsetKeyExpirationTime(boolean isCritical, long seconds)Set the number of seconds a key is valid for after the time of its creation.voidsetKeyFlags(boolean isCritical, int flags)voidsetNotationData(boolean isCritical, boolean isHumanReadable, java.lang.String notationName, java.lang.String notationValue)voidsetPreferredCompressionAlgorithms(boolean isCritical, int[] algorithms)voidsetPreferredHashAlgorithms(boolean isCritical, int[] algorithms)voidsetPreferredSymmetricAlgorithms(boolean isCritical, int[] algorithms)voidsetPrimaryUserID(boolean isCritical, boolean isPrimaryUserID)voidsetRevocable(boolean isCritical, boolean isRevocable)voidsetRevocationKey(boolean isCritical, int keyAlgorithm, byte[] fingerprint)Sets revocation key sub packetvoidsetRevocationReason(boolean isCritical, byte reason, java.lang.String description)Sets revocation reason sub packetvoidsetSignatureCreationTime(boolean isCritical, java.util.Date date)Set the creation time for the signature.voidsetSignatureExpirationTime(boolean isCritical, long seconds)Set the number of seconds a signature is valid for after the time of its creation.voidsetSignatureTarget(boolean isCritical, int publicKeyAlgorithm, int hashAlgorithm, byte[] hashData)Sets a signature target sub packet.voidsetSignerUserID(boolean isCritical, byte[] rawUserID)voidsetSignerUserID(boolean isCritical, java.lang.String userID)voidsetTrust(boolean isCritical, int depth, int trustAmount)Add a TrustSignature packet to the signature.
-
-
-
Method Detail
-
setRevocable
public void setRevocable(boolean isCritical, boolean isRevocable)
-
setExportable
public void setExportable(boolean isCritical, boolean isExportable)
-
setFeature
public void setFeature(boolean isCritical, byte feature)
-
setTrust
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- true if the packet is critical.depth- depth level.trustAmount- trust amount.
-
setKeyExpirationTime
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- true if should be treated as critical, false otherwise.seconds-
-
setSignatureExpirationTime
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- true if should be treated as critical, false otherwise.seconds-
-
setSignatureCreationTime
public void setSignatureCreationTime(boolean isCritical, java.util.Date date)Set the creation time for the signature.Note: this overrides the generation of a creation time when the signature is generated.
-
setPreferredHashAlgorithms
public void setPreferredHashAlgorithms(boolean isCritical, int[] algorithms)
-
setPreferredSymmetricAlgorithms
public void setPreferredSymmetricAlgorithms(boolean isCritical, int[] algorithms)
-
setPreferredCompressionAlgorithms
public void setPreferredCompressionAlgorithms(boolean isCritical, int[] algorithms)
-
setKeyFlags
public void setKeyFlags(boolean isCritical, int flags)
-
setSignerUserID
public void setSignerUserID(boolean isCritical, java.lang.String userID)
-
setSignerUserID
public void setSignerUserID(boolean isCritical, byte[] rawUserID)
-
setEmbeddedSignature
public void setEmbeddedSignature(boolean isCritical, PGPSignature pgpSignature) throws java.io.IOException- Throws:
java.io.IOException
-
setPrimaryUserID
public void setPrimaryUserID(boolean isCritical, boolean isPrimaryUserID)
-
setNotationData
public void setNotationData(boolean isCritical, boolean isHumanReadable, java.lang.String notationName, java.lang.String notationValue)
-
setRevocationReason
public void setRevocationReason(boolean isCritical, byte reason, java.lang.String description)Sets revocation reason sub packet
-
setRevocationKey
public void setRevocationKey(boolean isCritical, int keyAlgorithm, byte[] fingerprint)Sets revocation key sub packet
-
setIssuerKeyID
public void setIssuerKeyID(boolean isCritical, long keyID)Sets issuer key sub packet
-
setSignatureTarget
public void setSignatureTarget(boolean isCritical, int publicKeyAlgorithm, int hashAlgorithm, byte[] hashData)Sets a signature target sub packet.
-
setIssuerFingerprint
public void setIssuerFingerprint(boolean isCritical, PGPSecretKey secretKey)Sets the signature issuer fingerprint for the signing key.- Parameters:
isCritical- true if critical, false otherwise.secretKey- the secret key used to generate the associated signature.
-
setIssuerFingerprint
public void setIssuerFingerprint(boolean isCritical, PGPPublicKey publicKey)Sets the signature issuer fingerprint for the signing key.- Parameters:
isCritical- true if critical, false otherwise.publicKey- the public key needed to verify the associated signature.
-
setIntendedRecipientFingerprint
public void setIntendedRecipientFingerprint(boolean isCritical, PGPPublicKey publicKey)Sets the intended recipient fingerprint for an encrypted payload the signature is associated with.- Parameters:
isCritical- true if critical, false otherwise.publicKey- the public key the encrypted payload was encrypted against.
-
generate
public PGPSignatureSubpacketVector generate()
-
-