A PGP signature object.
BINARY_DOCUMENT
public static final int BINARY_DOCUMENT
CANONICAL_TEXT_DOCUMENT
public static final int CANONICAL_TEXT_DOCUMENT
CASUAL_CERTIFICATION
public static final int CASUAL_CERTIFICATION
CERTIFICATION_REVOCATION
public static final int CERTIFICATION_REVOCATION
DEFAULT_CERTIFICATION
public static final int DEFAULT_CERTIFICATION
DIRECT_KEY
public static final int DIRECT_KEY
KEY_REVOCATION
public static final int KEY_REVOCATION
NO_CERTIFICATION
public static final int NO_CERTIFICATION
POSITIVE_CERTIFICATION
public static final int POSITIVE_CERTIFICATION
STAND_ALONE
public static final int STAND_ALONE
SUBKEY_BINDING
public static final int SUBKEY_BINDING
SUBKEY_REVOCATION
public static final int SUBKEY_REVOCATION
TIMESTAMP
public static final int TIMESTAMP
encode
public void encode(OutputStream outStream)
throws IOException
getCreationTime
public Date getCreationTime()
Return the creation time of the signature.
- the signature creation time.
getEncoded
public byte[] getEncoded()
throws IOException
getHashAlgorithm
public int getHashAlgorithm()
Return the hash algorithm associated with this signature.
- signature hash algorithm.
getKeyAlgorithm
public int getKeyAlgorithm()
Return the key algorithm associated with this signature.
getKeyID
public long getKeyID()
Return the id of the key that created the signature.
- keyID of the signatures corresponding key.
getSignature
public byte[] getSignature()
throws PGPException
getSignatureTrailer
public byte[] getSignatureTrailer()
getSignatureType
public int getSignatureType()
getVersion
public int getVersion()
Return the OpenPGP version number for this signature.
- signature version number.
update
public void update(byte b)
throws SignatureException
update
public void update(byte[] bytes)
throws SignatureException
update
public void update(byte[] bytes,
int off,
int length)
throws SignatureException
verify
public boolean verify()
throws PGPException,
SignatureException
verifyCertification
public boolean verifyCertification(String id,
PGPPublicKey key)
throws PGPException,
SignatureException
Verify the signature as certifying the passed in public key as associated
with the passed in id.
id
- id the key was stored underkey
- the key to be verified.
- true if the signature matches, false otherwise.
verifyCertification
public boolean verifyCertification(PGPPublicKey pubKey)
throws SignatureException,
PGPException
Verify a key certification, such as a revocation, for the passed in key.
pubKey
- the key we are checking.
- true if the certification is valid, false otherwise.
verifyCertification
public boolean verifyCertification(PGPPublicKey masterKey,
PGPPublicKey pubKey)
throws SignatureException,
PGPException
Verify a certification for the passed in key against the passed in
master key.
masterKey
- the key we are verifying against.pubKey
- the key we are verifying.
- true if the certification is valid, false otherwise.