Bouncy Castle Cryptography Library 1.49

org.bouncycastle.openpgp
Class PGPV3SignatureGenerator

java.lang.Object
  extended by org.bouncycastle.openpgp.PGPV3SignatureGenerator

public class PGPV3SignatureGenerator
extends java.lang.Object

Generator for old style PGP V3 Signatures.


Constructor Summary
PGPV3SignatureGenerator(int keyAlgorithm, int hashAlgorithm, java.security.Provider provider)
          Deprecated. use constructor taking PGPContentSignerBuilder.
PGPV3SignatureGenerator(int keyAlgorithm, int hashAlgorithm, java.lang.String provider)
          Deprecated. use constructor taking PGPContentSignerBuilder.
PGPV3SignatureGenerator(PGPContentSignerBuilder contentSignerBuilder)
          Create a signature generator built on the passed in contentSignerBuilder.
 
Method Summary
 PGPSignature generate()
          Return a V3 signature object containing the current signature state.
 PGPOnePassSignature generateOnePassVersion(boolean isNested)
          Return the one pass header associated with the current signature.
 void init(int signatureType, PGPPrivateKey key)
          Initialise the generator for signing.
 void initSign(int signatureType, PGPPrivateKey key)
          Deprecated. use init()
 void initSign(int signatureType, PGPPrivateKey key, java.security.SecureRandom random)
          Deprecated. random now ignored - set random in PGPContentSignerBuilder
 void update(byte b)
           
 void update(byte[] b)
           
 void update(byte[] b, int off, int len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PGPV3SignatureGenerator

public PGPV3SignatureGenerator(int keyAlgorithm,
                               int hashAlgorithm,
                               java.lang.String provider)
                        throws java.security.NoSuchAlgorithmException,
                               java.security.NoSuchProviderException,
                               PGPException
Deprecated. use constructor taking PGPContentSignerBuilder.

Create a generator for the passed in keyAlgorithm and hashAlgorithm codes.

Parameters:
keyAlgorithm -
hashAlgorithm -
provider -
Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
PGPException

PGPV3SignatureGenerator

public PGPV3SignatureGenerator(int keyAlgorithm,
                               int hashAlgorithm,
                               java.security.Provider provider)
                        throws java.security.NoSuchAlgorithmException,
                               PGPException
Deprecated. use constructor taking PGPContentSignerBuilder.

Parameters:
keyAlgorithm -
hashAlgorithm -
provider -
Throws:
java.security.NoSuchAlgorithmException
PGPException

PGPV3SignatureGenerator

public PGPV3SignatureGenerator(PGPContentSignerBuilder contentSignerBuilder)
Create a signature generator built on the passed in contentSignerBuilder.

Parameters:
contentSignerBuilder - builder to produce PGPContentSigner objects for generating signatures.
Method Detail

init

public void init(int signatureType,
                 PGPPrivateKey key)
          throws PGPException
Initialise the generator for signing.

Parameters:
signatureType -
key -
Throws:
PGPException

initSign

public void initSign(int signatureType,
                     PGPPrivateKey key,
                     java.security.SecureRandom random)
              throws PGPException
Deprecated. random now ignored - set random in PGPContentSignerBuilder

Initialise the generator for signing.

Parameters:
signatureType -
key -
random -
Throws:
PGPException

initSign

public void initSign(int signatureType,
                     PGPPrivateKey key)
              throws PGPException
Deprecated. use init()

Initialise the generator for signing.

Parameters:
signatureType -
key -
Throws:
PGPException

update

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

update

public void update(byte[] b)
            throws java.security.SignatureException
Throws:
java.security.SignatureException

update

public void update(byte[] b,
                   int off,
                   int len)
            throws java.security.SignatureException
Throws:
java.security.SignatureException

generateOnePassVersion

public PGPOnePassSignature generateOnePassVersion(boolean isNested)
                                           throws PGPException
Return the one pass header associated with the current signature.

Parameters:
isNested -
Returns:
PGPOnePassSignature
Throws:
PGPException

generate

public PGPSignature generate()
                      throws PGPException,
                             java.security.SignatureException
Return a V3 signature object containing the current signature state.

Returns:
PGPSignature
Throws:
PGPException
java.security.SignatureException

Bouncy Castle Cryptography Library 1.49