public class PGPSignature
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
BINARY_DOCUMENT |
static int |
CANONICAL_TEXT_DOCUMENT |
static int |
CASUAL_CERTIFICATION |
static int |
CERTIFICATION_REVOCATION |
static int |
DEFAULT_CERTIFICATION |
static int |
DIRECT_KEY |
static int |
KEY_REVOCATION |
static int |
NO_CERTIFICATION |
static int |
POSITIVE_CERTIFICATION |
static int |
PRIMARYKEY_BINDING |
static int |
STAND_ALONE |
static int |
SUBKEY_BINDING |
static int |
SUBKEY_REVOCATION |
static int |
TIMESTAMP |
Modifier and Type | Method and Description |
---|---|
void |
encode(java.io.OutputStream outStream) |
java.util.Date |
getCreationTime()
Return the creation time of the signature.
|
byte[] |
getEncoded() |
int |
getHashAlgorithm()
Return the hash algorithm associated with this signature.
|
PGPSignatureSubpacketVector |
getHashedSubPackets() |
int |
getKeyAlgorithm()
Return the key algorithm associated with this signature.
|
long |
getKeyID()
Return the id of the key that created the signature.
|
byte[] |
getSignature() |
byte[] |
getSignatureTrailer() |
int |
getSignatureType() |
PGPSignatureSubpacketVector |
getUnhashedSubPackets() |
int |
getVersion()
Return the OpenPGP version number for this signature.
|
boolean |
hasSubpackets()
Return true if the signature has either hashed or unhashed subpackets.
|
void |
initVerify(PGPPublicKey pubKey,
java.security.Provider provider) |
void |
initVerify(PGPPublicKey pubKey,
java.lang.String provider) |
void |
update(byte b) |
void |
update(byte[] bytes) |
void |
update(byte[] bytes,
int off,
int length) |
boolean |
verify() |
boolean |
verifyCertification(PGPPublicKey pubKey)
Verify a key certification, such as a revocation, for the passed in key.
|
boolean |
verifyCertification(PGPPublicKey masterKey,
PGPPublicKey pubKey)
Verify a certification for the passed in key against the passed in
master key.
|
boolean |
verifyCertification(PGPUserAttributeSubpacketVector userAttributes,
PGPPublicKey key)
Verify the signature as certifying the passed in public key as associated
with the passed in user attributes.
|
boolean |
verifyCertification(java.lang.String id,
PGPPublicKey key)
Verify the signature as certifying the passed in public key as associated
with the passed in id.
|
public static final int BINARY_DOCUMENT
public static final int CANONICAL_TEXT_DOCUMENT
public static final int STAND_ALONE
public static final int DEFAULT_CERTIFICATION
public static final int NO_CERTIFICATION
public static final int CASUAL_CERTIFICATION
public static final int POSITIVE_CERTIFICATION
public static final int SUBKEY_BINDING
public static final int PRIMARYKEY_BINDING
public static final int DIRECT_KEY
public static final int KEY_REVOCATION
public static final int SUBKEY_REVOCATION
public static final int CERTIFICATION_REVOCATION
public static final int TIMESTAMP
public int getVersion()
public int getKeyAlgorithm()
public int getHashAlgorithm()
public void initVerify(PGPPublicKey pubKey, java.lang.String provider) throws java.security.NoSuchProviderException, PGPException
java.security.NoSuchProviderException
PGPException
public void initVerify(PGPPublicKey pubKey, java.security.Provider provider) throws PGPException
PGPException
public void update(byte b) throws java.security.SignatureException
java.security.SignatureException
public void update(byte[] bytes) throws java.security.SignatureException
java.security.SignatureException
public void update(byte[] bytes, int off, int length) throws java.security.SignatureException
java.security.SignatureException
public boolean verify() throws PGPException, java.security.SignatureException
PGPException
java.security.SignatureException
public boolean verifyCertification(PGPUserAttributeSubpacketVector userAttributes, PGPPublicKey key) throws PGPException, java.security.SignatureException
userAttributes
- user attributes the key was stored underkey
- the key to be verified.PGPException
java.security.SignatureException
public boolean verifyCertification(java.lang.String id, PGPPublicKey key) throws PGPException, java.security.SignatureException
id
- id the key was stored underkey
- the key to be verified.PGPException
java.security.SignatureException
public boolean verifyCertification(PGPPublicKey masterKey, PGPPublicKey pubKey) throws java.security.SignatureException, PGPException
masterKey
- the key we are verifying against.pubKey
- the key we are verifying.java.security.SignatureException
PGPException
public boolean verifyCertification(PGPPublicKey pubKey) throws java.security.SignatureException, PGPException
pubKey
- the key we are checking.java.security.SignatureException
PGPException
public int getSignatureType()
public long getKeyID()
public java.util.Date getCreationTime()
public byte[] getSignatureTrailer()
public boolean hasSubpackets()
public PGPSignatureSubpacketVector getHashedSubPackets()
public PGPSignatureSubpacketVector getUnhashedSubPackets()
public byte[] getSignature() throws PGPException
PGPException
public byte[] getEncoded() throws java.io.IOException
java.io.IOException
public void encode(java.io.OutputStream outStream) throws java.io.IOException
java.io.IOException