Package org.bouncycastle.openpgp
Class PGPOnePassSignature
- java.lang.Object
-
- org.bouncycastle.openpgp.PGPOnePassSignature
-
public class PGPOnePassSignature extends java.lang.Object
A one pass signature object.
-
-
Constructor Summary
Constructors Constructor Description PGPOnePassSignature(BCPGInputStream pIn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
encode(java.io.OutputStream outStream)
byte[]
getEncoded()
int
getHashAlgorithm()
int
getKeyAlgorithm()
long
getKeyID()
int
getSignatureType()
void
init(PGPContentVerifierBuilderProvider verifierBuilderProvider, PGPPublicKey pubKey)
Initialise the signature object for verification.boolean
isContaining()
Return true, if the signature is contains any signatures that follow.void
update(byte b)
void
update(byte[] bytes)
void
update(byte[] bytes, int off, int length)
boolean
verify(PGPSignature pgpSig)
Verify the calculated signature against the passed in PGPSignature.
-
-
-
Constructor Detail
-
PGPOnePassSignature
public PGPOnePassSignature(BCPGInputStream pIn) throws java.io.IOException, PGPException
- Throws:
java.io.IOException
PGPException
-
-
Method Detail
-
init
public void init(PGPContentVerifierBuilderProvider verifierBuilderProvider, PGPPublicKey pubKey) throws PGPException
Initialise the signature object for verification.- Parameters:
verifierBuilderProvider
- provider for a content verifier builder for the signature type of interest.pubKey
- the public key to use for verification- Throws:
PGPException
- if there's an issue with creating the verifier.
-
update
public void update(byte b)
-
update
public void update(byte[] bytes)
-
update
public void update(byte[] bytes, int off, int length)
-
verify
public boolean verify(PGPSignature pgpSig) throws PGPException
Verify the calculated signature against the passed in PGPSignature.- Parameters:
pgpSig
-- Returns:
- boolean
- Throws:
PGPException
-
getKeyID
public long getKeyID()
-
getSignatureType
public int getSignatureType()
-
getHashAlgorithm
public int getHashAlgorithm()
-
getKeyAlgorithm
public int getKeyAlgorithm()
-
isContaining
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:
- true if containing, false otherwise
-
getEncoded
public byte[] getEncoded() throws java.io.IOException
- Throws:
java.io.IOException
-
encode
public void encode(java.io.OutputStream outStream) throws java.io.IOException
- Throws:
java.io.IOException
-
-