Top Description Fields Constructors Methods
org.bouncycastle.openpgp

public Class PGPOnePassSignature

extends Object
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStream, org.bouncycastle.bcpg.BCPGInputStream, .BCPGOutputStream, .OnePassSignaturePacket, .Packet, org.bouncycastle.openpgp.operator.PGPContentVerifier, .PGPContentVerifierBuilder, .PGPContentVerifierBuilderProvider

A one pass signature object.

Field Summary

Modifier and TypeField and Description
private byte
private int
private OutputStream
private OnePassSignaturePacket
private PGPContentVerifier

Constructor Summary

AccessConstructor and Description
public
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
blockUpdate(byte[] block, int off, int len)

private void
byteUpdate(byte b)

private static OnePassSignaturePacket
cast(Packet packet)

public void
encode(OutputStream outStream)

public byte[]
public int
public int
public long
public int
public void
init(PGPContentVerifierBuilderProvider
provider for a content verifier builder for the signature type of interest.
verifierBuilderProvider
,
PGPPublicKey
the public key to use for verification
pubKey
)

Initialise the signature object for verification.

public boolean

Returns:

true if containing, false otherwise
isContaining
()

Return true, if the signature is contains any signatures that follow.

public void
update(byte b)

public void
update(byte[] bytes)

public void
update(byte[] bytes, int off, int length)

public boolean

Returns:

boolean
verify
(PGPSignature pgpSig)

Verify the calculated signature against the passed in PGPSignature.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lastbback to summary
private byte lastb
signatureTypeback to summary
private int signatureType
sigOutback to summary
private OutputStream sigOut
sigPackback to summary
private OnePassSignaturePacket sigPack
verifierback to summary
private PGPContentVerifier verifier

Constructor Detail

PGPOnePassSignatureback to summary
public PGPOnePassSignature(BCPGInputStream pIn) throws IOException, PGPException
PGPOnePassSignatureback to summary
pack-priv PGPOnePassSignature(OnePassSignaturePacket sigPack) throws PGPException

Method Detail

blockUpdateback to summary
private void blockUpdate(byte[] block, int off, int len)
byteUpdateback to summary
private void byteUpdate(byte b)
castback to summary
private static OnePassSignaturePacket cast(Packet packet) throws IOException
encodeback to summary
public void encode(OutputStream outStream) throws IOException
getEncodedback to summary
public byte[] getEncoded() throws IOException
getHashAlgorithmback to summary
public int getHashAlgorithm()
getKeyAlgorithmback to summary
public int getKeyAlgorithm()
getKeyIDback to summary
public long getKeyID()
getSignatureTypeback to summary
public int getSignatureType()
initback to summary
public void init(PGPContentVerifierBuilderProvider verifierBuilderProvider, PGPPublicKey pubKey) throws PGPException

Initialise the signature object for verification.

Parameters
verifierBuilderProvider:PGPContentVerifierBuilderProvider

provider for a content verifier builder for the signature type of interest.

pubKey:PGPPublicKey

the public key to use for verification

Exceptions
PGPException:
if there's an issue with creating the verifier.
isContainingback to summary
public boolean isContaining()

Return true, if the signature is contains any signatures that follow. An bracketing OPS is followed by additional OPS packets and is calculated over all the data between itself and its corresponding signature (it is an attestation for contained signatures).

Returns:boolean

true if containing, false otherwise

updateback to summary
public void update(byte b)
updateback to summary
public void update(byte[] bytes)
updateback to summary
public void update(byte[] bytes, int off, int length)
verifyback to summary
public boolean verify(PGPSignature pgpSig) throws PGPException

Verify the calculated signature against the passed in PGPSignature.

Returns:boolean

boolean