org.apache.commons.openpgp

Class BouncyCastleOpenPgpStreamingSignatureVerifier

Implemented Interfaces:
OpenPgpStreamingSignatureVerifier

public class BouncyCastleOpenPgpStreamingSignatureVerifier
extends java.lang.Object
implements OpenPgpStreamingSignatureVerifier

Bouncy Castle implementation of the OpenPGP signer.
Author:
Brett Porter

Fields inherited from interface org.apache.commons.openpgp.OpenPgpStreamingSignatureVerifier

ROLE

Constructor Summary

BouncyCastleOpenPgpStreamingSignatureVerifier(InputStream signature, KeyRing keyRing, boolean asciiArmor)

Method Summary

SignatureStatus
finish()
Finish and verify the signature that has been obtained.
void
update(byte[] buf)
Update the signature with the next block from the data buffer.
void
update(byte[] buf, int offset, int length)
Update the signature with the next block from the data buffer.
SignatureStatus
verify()

Constructor Details

BouncyCastleOpenPgpStreamingSignatureVerifier

public BouncyCastleOpenPgpStreamingSignatureVerifier(InputStream signature,
                                                     KeyRing keyRing,
                                                     boolean asciiArmor)
            throws OpenPgpException,
                   IOException

Method Details

finish

public SignatureStatus finish()
            throws OpenPgpException,
                   IOException
Finish and verify the signature that has been obtained.
Specified by:
finish in interface OpenPgpStreamingSignatureVerifier
Returns:
the status of the signature
Throws:
OpenPgpException - if the signature is not in a consistent or complete state

update

public void update(byte[] buf)
            throws OpenPgpException
Update the signature with the next block from the data buffer.
Specified by:
update in interface OpenPgpStreamingSignatureVerifier
Parameters:
buf - the buffer
Throws:
OpenPgpException - if the buffer is not valid for updating the signature

update

public void update(byte[] buf,
                   int offset,
                   int length)
            throws OpenPgpException
Update the signature with the next block from the data buffer.
Specified by:
update in interface OpenPgpStreamingSignatureVerifier
Parameters:
buf - the buffer
offset - offset within the buffer to start from
length - number of bytes in the buffer to read from
Throws:
OpenPgpException - if the buffer is not valid for updating the signature

verify

public SignatureStatus verify()