public class PGPSignatureGenerator extends Object
Constructor and Description |
---|
PGPSignatureGenerator(int keyAlgorithm,
int hashAlgorithm,
Provider provider) |
PGPSignatureGenerator(int keyAlgorithm,
int hashAlgorithm,
String provider)
Create a generator for the passed in keyAlgorithm and hashAlgorithm codes.
|
PGPSignatureGenerator(int keyAlgorithm,
Provider sigProvider,
int hashAlgorithm,
Provider digProvider) |
PGPSignatureGenerator(int keyAlgorithm,
String sigProvider,
int hashAlgorithm,
String digProvider)
Create a generator for the passed in keyAlgorithm and hashAlgorithm codes.
|
Modifier and Type | Method and Description |
---|---|
PGPSignature |
generate()
Return a signature object containing the current signature state.
|
PGPSignature |
generateCertification(PGPPublicKey pubKey)
Generate a certification, such as a revocation, for the passed in key.
|
PGPSignature |
generateCertification(PGPPublicKey masterKey,
PGPPublicKey pubKey)
Generate a certification for the passed in key against the passed in
master key.
|
PGPSignature |
generateCertification(PGPUserAttributeSubpacketVector userAttributes,
PGPPublicKey pubKey)
Generate a certification for the passed in userAttributes
|
PGPSignature |
generateCertification(String id,
PGPPublicKey pubKey)
Generate a certification for the passed in id and key.
|
PGPOnePassSignature |
generateOnePassVersion(boolean isNested)
Return the one pass header associated with the current signature.
|
void |
initSign(int signatureType,
PGPPrivateKey key)
Initialise the generator for signing.
|
void |
initSign(int signatureType,
PGPPrivateKey key,
SecureRandom random)
Initialise the generator for signing.
|
void |
setHashedSubpackets(PGPSignatureSubpacketVector hashedPcks) |
void |
setUnhashedSubpackets(PGPSignatureSubpacketVector unhashedPcks) |
void |
update(byte b) |
void |
update(byte[] b) |
void |
update(byte[] b,
int off,
int len) |
public PGPSignatureGenerator(int keyAlgorithm, int hashAlgorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException, PGPException
keyAlgorithm
- keyAlgorithm to use for signinghashAlgorithm
- algorithm to use for digestprovider
- provider to use for digest algorithmNoSuchAlgorithmException
NoSuchProviderException
PGPException
public PGPSignatureGenerator(int keyAlgorithm, int hashAlgorithm, Provider provider) throws NoSuchAlgorithmException, PGPException
NoSuchAlgorithmException
PGPException
public PGPSignatureGenerator(int keyAlgorithm, String sigProvider, int hashAlgorithm, String digProvider) throws NoSuchAlgorithmException, NoSuchProviderException, PGPException
keyAlgorithm
- keyAlgorithm to use for signingsigProvider
- provider to use for signature generationhashAlgorithm
- algorithm to use for digestdigProvider
- provider to use for digest algorithmNoSuchAlgorithmException
NoSuchProviderException
PGPException
public PGPSignatureGenerator(int keyAlgorithm, Provider sigProvider, int hashAlgorithm, Provider digProvider) throws NoSuchAlgorithmException, PGPException
NoSuchAlgorithmException
PGPException
public void initSign(int signatureType, PGPPrivateKey key) throws PGPException
signatureType
- key
- PGPException
public void initSign(int signatureType, PGPPrivateKey key, SecureRandom random) throws PGPException
signatureType
- key
- random
- PGPException
public void update(byte b) throws SignatureException
SignatureException
public void update(byte[] b) throws SignatureException
SignatureException
public void update(byte[] b, int off, int len) throws SignatureException
SignatureException
public void setHashedSubpackets(PGPSignatureSubpacketVector hashedPcks)
public void setUnhashedSubpackets(PGPSignatureSubpacketVector unhashedPcks)
public PGPOnePassSignature generateOnePassVersion(boolean isNested) throws PGPException
isNested
- PGPException
public PGPSignature generate() throws PGPException, SignatureException
PGPException
SignatureException
public PGPSignature generateCertification(String id, PGPPublicKey pubKey) throws SignatureException, PGPException
id
- the id we are certifying against the public key.pubKey
- the key we are certifying against the id.SignatureException
PGPException
public PGPSignature generateCertification(PGPUserAttributeSubpacketVector userAttributes, PGPPublicKey pubKey) throws SignatureException, PGPException
userAttributes
- the id we are certifying against the public key.pubKey
- the key we are certifying against the id.SignatureException
PGPException
public PGPSignature generateCertification(PGPPublicKey masterKey, PGPPublicKey pubKey) throws SignatureException, PGPException
masterKey
- the key we are certifying against.pubKey
- the key we are certifying.SignatureException
PGPException
public PGPSignature generateCertification(PGPPublicKey pubKey) throws SignatureException, PGPException
pubKey
- the key we are certifying.SignatureException
PGPException