org.apache.commons.openpgp

Interface OpenPgpSigner

Known Implementing Classes:
BouncyCastleOpenPgpSigner

public interface OpenPgpSigner

Interface for signing data with OpenPGP.
Author:
Brett Porter

Field Summary

static String
ROLE

Method Summary

void
detachedSign(InputStream data, OutputStream signature, String keyId, KeyRing keyRing, boolean asciiArmor)
Sign a piece of data with the given key, storing the signature in a detached output.
void
sign(InputStream data, OutputStream signedOutput, String keyId, KeyRing keyRing, boolean asciiArmor)
Sign a piece of data with the given key.

Field Details

ROLE

public static final String ROLE

Method Details

detachedSign

public void detachedSign(InputStream data,
                         OutputStream signature,
                         String keyId,
                         KeyRing keyRing,
                         boolean asciiArmor)
            throws OpenPgpException,
                   IOException
Sign a piece of data with the given key, storing the signature in a detached output.
Parameters:
data - the data to sign
signature - the detached signature
keyId - the key ID of the key used to sign it
keyRing - the keyring containing the key above
asciiArmor - whether to ascii armor the output

sign

public void sign(InputStream data,
                 OutputStream signedOutput,
                 String keyId,
                 KeyRing keyRing,
                 boolean asciiArmor)
            throws OpenPgpException
Sign a piece of data with the given key.
Parameters:
data - the data to sign
signedOutput - the signed output data
keyId - the key ID of the key used to sign it
keyRing - the keyring containing the key above
asciiArmor - whether to ascii armor the output