Bouncy Castle Cryptography 1.26

org.bouncycastle.openpgp
Class PGPSignature

java.lang.Object
  |
  +--org.bouncycastle.openpgp.PGPSignature

public class PGPSignature
extends java.lang.Object

A PGP signature object.


Field Summary
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 STAND_ALONE
           
static int SUBKEY_BINDING
           
static int SUBKEY_REVOCATION
           
static int TIMESTAMP
           
 
Method Summary
 void encode(java.io.OutputStream outStream)
           
 java.util.Date getCreationTime()
          Return the creation time of the signature.
 byte[] getEncoded()
           
 PGPSignatureSubpacketVector getHashedSubPackets()
           
 long getKeyID()
          Return the id of the key that created the signature.
 byte[] getSignature()
           
 byte[] getSignatureTrailer()
           
 int getSignatureType()
           
 PGPSignatureSubpacketVector getUnhashedSubPackets()
           
 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(java.lang.String id, PGPPublicKey key)
          Verify the signature as certifying the passed in public key as associated with the passed in id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BINARY_DOCUMENT

public static final int BINARY_DOCUMENT

CANONICAL_TEXT_DOCUMENT

public static final int CANONICAL_TEXT_DOCUMENT

STAND_ALONE

public static final int STAND_ALONE

DEFAULT_CERTIFICATION

public static final int DEFAULT_CERTIFICATION

NO_CERTIFICATION

public static final int NO_CERTIFICATION

CASUAL_CERTIFICATION

public static final int CASUAL_CERTIFICATION

POSITIVE_CERTIFICATION

public static final int POSITIVE_CERTIFICATION

SUBKEY_BINDING

public static final int SUBKEY_BINDING

DIRECT_KEY

public static final int DIRECT_KEY

KEY_REVOCATION

public static final int KEY_REVOCATION

SUBKEY_REVOCATION

public static final int SUBKEY_REVOCATION

CERTIFICATION_REVOCATION

public static final int CERTIFICATION_REVOCATION

TIMESTAMP

public static final int TIMESTAMP
Method Detail

initVerify

public void initVerify(PGPPublicKey pubKey,
                       java.lang.String provider)
                throws java.security.NoSuchProviderException,
                       PGPException

update

public void update(byte b)
            throws java.security.SignatureException

update

public void update(byte[] bytes)
            throws java.security.SignatureException

update

public void update(byte[] bytes,
                   int off,
                   int length)
            throws java.security.SignatureException

verify

public boolean verify()
               throws PGPException,
                      java.security.SignatureException

verifyCertification

public boolean verifyCertification(java.lang.String id,
                                   PGPPublicKey key)
                            throws PGPException,
                                   java.security.SignatureException
Verify the signature as certifying the passed in public key as associated with the passed in id.
Parameters:
id - id the key was stored under
key - the key to be verified.
Returns:
true if the signature matches, false otherwise.
Throws:
PGPException -  
java.security.SignatureException -  

verifyCertification

public boolean verifyCertification(PGPPublicKey masterKey,
                                   PGPPublicKey pubKey)
                            throws java.security.SignatureException,
                                   PGPException
Verify a certification for the passed in key against the passed in master key.
Parameters:
masterKey - the key we are verifying against.
pubKey - the key we are verifying.
Returns:
true if the certification is valid, false otherwise.
Throws:
java.security.SignatureException -  
PGPException -  

verifyCertification

public boolean verifyCertification(PGPPublicKey pubKey)
                            throws java.security.SignatureException,
                                   PGPException
Verify a key certification, such as a revocation, for the passed in key.
Parameters:
pubKey - the key we are checking.
Returns:
true if the certification is valid, false otherwise.
Throws:
java.security.SignatureException -  
PGPException -  

getSignatureType

public int getSignatureType()

getKeyID

public long getKeyID()
Return the id of the key that created the signature.
Returns:
keyID of the signatures corresponding key.

getCreationTime

public java.util.Date getCreationTime()
Return the creation time of the signature.
Returns:
the signature creation time.

getSignatureTrailer

public byte[] getSignatureTrailer()

getHashedSubPackets

public PGPSignatureSubpacketVector getHashedSubPackets()

getUnhashedSubPackets

public PGPSignatureSubpacketVector getUnhashedSubPackets()

getSignature

public byte[] getSignature()
                    throws PGPException

getEncoded

public byte[] getEncoded()
                  throws java.io.IOException

encode

public void encode(java.io.OutputStream outStream)
            throws java.io.IOException

Bouncy Castle Cryptography 1.26