org.bouncycastle.bcpg

Class SignaturePacket

public class SignaturePacket extends ContainedPacket implements PublicKeyAlgorithmTags

generic signature packet
Constructor Summary
SignaturePacket(int signatureType, long keyID, int keyAlgorithm, int hashAlgorithm, SignatureSubpacket[] hashedData, SignatureSubpacket[] unhashedData, byte[] fingerPrint, MPInteger[] signature)
Generate a version 4 signature packet.
SignaturePacket(int version, int signatureType, long keyID, int keyAlgorithm, int hashAlgorithm, long creationTime, byte[] fingerPrint, MPInteger[] signature)
Generate a version 2/3 signature packet.
SignaturePacket(int version, int signatureType, long keyID, int keyAlgorithm, int hashAlgorithm, SignatureSubpacket[] hashedData, SignatureSubpacket[] unhashedData, byte[] fingerPrint, MPInteger[] signature)
Method Summary
voidencode(BCPGOutputStream out)
longgetCreationTime()
Return the creation time of the signature in milli-seconds.
intgetHashAlgorithm()
return the hashAlgorithm tag
SignatureSubpacket[]getHashedSubPackets()
intgetKeyAlgorithm()
return the encryption algorithm tag
longgetKeyID()
return the keyID
MPInteger[]getSignature()
return the signature as a set of integers - note this is normalised to be the ASN.1 encoding of what appears in the signature packet.
byte[]getSignatureBytes()
Return the byte encoding of the signature section.
byte[]getSignatureTrailer()
return the signature trailer that must be included with the data to reconstruct the signature
intgetSignatureType()
return the signature type.
SignatureSubpacket[]getUnhashedSubPackets()
intgetVersion()
get the version number

Constructor Detail

SignaturePacket

public SignaturePacket(int signatureType, long keyID, int keyAlgorithm, int hashAlgorithm, SignatureSubpacket[] hashedData, SignatureSubpacket[] unhashedData, byte[] fingerPrint, MPInteger[] signature)
Generate a version 4 signature packet.

Parameters: signatureType keyAlgorithm hashAlgorithm hashedData unhashedData fingerPrint signature

SignaturePacket

public SignaturePacket(int version, int signatureType, long keyID, int keyAlgorithm, int hashAlgorithm, long creationTime, byte[] fingerPrint, MPInteger[] signature)
Generate a version 2/3 signature packet.

Parameters: signatureType keyAlgorithm hashAlgorithm fingerPrint signature

SignaturePacket

public SignaturePacket(int version, int signatureType, long keyID, int keyAlgorithm, int hashAlgorithm, SignatureSubpacket[] hashedData, SignatureSubpacket[] unhashedData, byte[] fingerPrint, MPInteger[] signature)

Method Detail

encode

public void encode(BCPGOutputStream out)

getCreationTime

public long getCreationTime()
Return the creation time of the signature in milli-seconds.

Returns: the creation time in millis

getHashAlgorithm

public int getHashAlgorithm()
return the hashAlgorithm tag

getHashedSubPackets

public SignatureSubpacket[] getHashedSubPackets()

getKeyAlgorithm

public int getKeyAlgorithm()
return the encryption algorithm tag

getKeyID

public long getKeyID()
return the keyID

Returns: the keyID that created the signature.

getSignature

public MPInteger[] getSignature()
return the signature as a set of integers - note this is normalised to be the ASN.1 encoding of what appears in the signature packet.

getSignatureBytes

public byte[] getSignatureBytes()
Return the byte encoding of the signature section.

Returns: uninterpreted signature bytes.

getSignatureTrailer

public byte[] getSignatureTrailer()
return the signature trailer that must be included with the data to reconstruct the signature

Returns: byte[]

getSignatureType

public int getSignatureType()
return the signature type.

getUnhashedSubPackets

public SignatureSubpacket[] getUnhashedSubPackets()

getVersion

public int getVersion()
get the version number