Top Description Fields Constructors Methods
org.bouncycastle.openpgp

public Class PGPOnePassSignature

extends PGPDefaultSignatureGenerator
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStream, org.bouncycastle.bcpg.BCPGInputStream, .BCPGOutputStream, .HashUtils, .KeyIdentifier, .OnePassSignaturePacket, .Packet, .SignaturePacket, org.bouncycastle.openpgp.operator.PGPContentVerifier, .PGPContentVerifierBuilder, .PGPContentVerifierBuilderProvider, org.bouncycastle.util.Arrays

A one pass signature object.

Field Summary

Modifier and TypeField and Description
private OnePassSignaturePacket
private PGPContentVerifier
Inherited from org.bouncycastle.openpgp.PGPDefaultSignatureGenerator:
lastbsigOutsigTypeversion

Constructor Summary

AccessConstructor and Description
public
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static OnePassSignaturePacket
cast(Packet packet)

private void
private void
public void
encode(OutputStream outStream)

public byte[]
public byte[]

Returns:

fingerprint
getFingerprint
()

Return the issuer key fingerprint.

public int
public int
public long

Returns:

key-ID
getKeyID
()

Return the key-ID of the issuer signing key.

public KeyIdentifier

Returns:

key identifier
getKeyIdentifier
()

Return a KeyIdentifier identifying this PGPOnePassSignature.

public byte[]

Returns:

salt
getSalt
()

Return the salt used in the corresponding signature.

public int
public int

Returns:

packet version
getVersion
()

Return the packet version.

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 contains any signatures that follow.

private void
public boolean

Returns:

boolean
verify
(PGPSignature pgpSig)

Verify the calculated signature against the passed in PGPSignature.

Inherited from org.bouncycastle.openpgp.PGPDefaultSignatureGenerator:
blockUpdategetAttributesHashupdateupdateupdateupdateWithIdDataupdateWithPublicKey

Field Detail

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)

Method Detail

castback to summary
private static OnePassSignaturePacket cast(Packet packet) throws IOException
checkSaltSizeback to summary
private void checkSaltSize() throws PGPException
compareSaltback to summary
private void compareSalt(PGPSignature signature) throws PGPException
encodeback to summary
public void encode(OutputStream outStream) throws IOException
getEncodedback to summary
public byte[] getEncoded() throws IOException
getFingerprintback to summary
public byte[] getFingerprint()

Return the issuer key fingerprint. Only for OnePassSignaturePacket#VERSION_6 packets.

Returns:byte[]

fingerprint

getHashAlgorithmback to summary
public int getHashAlgorithm()
getKeyAlgorithmback to summary
public int getKeyAlgorithm()
getKeyIDback to summary
public long getKeyID()

Return the key-ID of the issuer signing key. For OnePassSignaturePacket#VERSION_6 packets, the key-ID is derived from the fingerprint.

Returns:long

key-ID

getKeyIdentifierback to summary
public KeyIdentifier getKeyIdentifier()

Return a KeyIdentifier identifying this PGPOnePassSignature.

Returns:KeyIdentifier

key identifier

getSaltback to summary
public byte[] getSalt()

Return the salt used in the corresponding signature. Only for OnePassSignaturePacket#VERSION_6 packets.

Returns:byte[]

salt

getSignatureTypeback to summary
public int getSignatureType()
getVersionback to summary
public int getVersion()

Return the packet version.

Returns:int

packet version

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 contains any signatures that follow. A 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

updateWithSaltback to summary
private void updateWithSalt() throws PGPException
verifyback to summary
public boolean verify(PGPSignature pgpSig) throws PGPException

Verify the calculated signature against the passed in PGPSignature.

Returns:boolean

boolean