Package org.bouncycastle.openpgp
Class PGPOnePassSignature
java.lang.Object
org.bouncycastle.openpgp.PGPOnePassSignature
A one pass signature object.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidblockUpdate(byte[] block, int off, int len) voidencode(OutputStream outStream) protected voidgetAttriubtesHash(PGPUserAttributeSubpacketVector userAttributes) byte[]intintlonggetKeyID()intvoidinit(PGPContentVerifierBuilderProvider verifierBuilderProvider, PGPPublicKey pubKey) Initialise the signature object for verification.booleanReturn true, if the signature is contains any signatures that follow.voidupdate(byte b) voidupdate(byte[] b) voidupdate(byte[] b, int off, int len) protected voidupdateWithIdData(int header, byte[] idBytes) protected voidbooleanverify(PGPSignature pgpSig) Verify the calculated signature against the passed in PGPSignature.
-
Field Details
-
lastb
protected byte lastb -
sigOut
-
sigType
protected int sigType
-
-
Constructor Details
-
PGPOnePassSignature
- Throws:
IOExceptionPGPException
-
-
Method Details
-
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.
-
verify
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
- Throws:
IOException
-
encode
- Throws:
IOException
-
update
public void update(byte b) -
update
public void update(byte[] b) -
update
public void update(byte[] b, int off, int len) -
blockUpdate
protected void blockUpdate(byte[] block, int off, int len) -
updateWithIdData
protected void updateWithIdData(int header, byte[] idBytes) -
updateWithPublicKey
- Throws:
PGPException
-
getAttriubtesHash
protected void getAttriubtesHash(PGPUserAttributeSubpacketVector userAttributes) throws PGPException - Throws:
PGPException
-