org.apache.commons.openpgp
Class BouncyCastleOpenPgpStreamingSigner

java.lang.Object
  extended by org.apache.commons.openpgp.BouncyCastleOpenPgpStreamingSigner
All Implemented Interfaces:
OpenPgpStreamingSigner

public class BouncyCastleOpenPgpStreamingSigner
extends Object
implements OpenPgpStreamingSigner

Bouncy Castle implementation of the OpenPGP signer.

Author:
Brett Porter

Field Summary
 
Fields inherited from interface org.apache.commons.openpgp.OpenPgpStreamingSigner
ROLE
 
Constructor Summary
BouncyCastleOpenPgpStreamingSigner(OutputStream signature, String keyId, KeyRing keyRing, boolean asciiArmor)
           
BouncyCastleOpenPgpStreamingSigner(String keyId, KeyRing keyRing, boolean asciiArmor)
           
 
Method Summary
 byte[] finish()
          Finish creating the signature.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BouncyCastleOpenPgpStreamingSigner

public BouncyCastleOpenPgpStreamingSigner(String keyId,
                                          KeyRing keyRing,
                                          boolean asciiArmor)
                                   throws OpenPgpException
Throws:
OpenPgpException

BouncyCastleOpenPgpStreamingSigner

public BouncyCastleOpenPgpStreamingSigner(OutputStream signature,
                                          String keyId,
                                          KeyRing keyRing,
                                          boolean asciiArmor)
                                   throws OpenPgpException
Throws:
OpenPgpException
Method Detail

update

public void update(byte[] buf)
            throws OpenPgpException
Description copied from interface: OpenPgpStreamingSigner
Update the signature with the next block from the data buffer.

Specified by:
update in interface OpenPgpStreamingSigner
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
Description copied from interface: OpenPgpStreamingSigner
Update the signature with the next block from the data buffer.

Specified by:
update in interface OpenPgpStreamingSigner
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

finish

public byte[] finish()
              throws OpenPgpException,
                     IOException
Description copied from interface: OpenPgpStreamingSigner
Finish creating the signature.

Specified by:
finish in interface OpenPgpStreamingSigner
Returns:
the completed signature
Throws:
OpenPgpException - if the signature is not in a consistent or complete state
IOException


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.