Top Description Fields Constructors Methods
org.bouncycastle.bcpg

public Class SignaturePacket

extends ContainedPacket
implements PublicKeyAlgorithmTags
Class Inheritance
All Implemented Interfaces
org.bouncycastle.bcpg.PublicKeyAlgorithmTags
Imports
java.io.ByteArrayInputStream, .ByteArrayOutputStream, .IOException, java.util.Vector, org.bouncycastle.bcpg.sig.IssuerKeyID, .SignatureCreationTime, org.bouncycastle.util.Arrays, org.bouncycastle.util.io.Streams

generic signature packet

Field Summary

Modifier and TypeField and Description
private long
private byte[]
private int
private SignatureSubpacket[]
private int
private long
private MPInteger[]
private byte[]
private int
private SignatureSubpacket[]
private int

Constructor Summary

AccessConstructor and Description
pack-priv
public
SignaturePacket(int signatureType, long keyID, int keyAlgorithm, int hashAlgorithm, SignatureSubpacket[] hashedData, SignatureSubpacket[] unhashedData, byte[] fingerPrint, MPInteger[] signature)

Generate a version 4 signature packet.

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.

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

Method Summary

Modifier and TypeMethod and Description
public void
public static SignaturePacket
fromByteArray(byte[] data)

public long

Returns:

the creation time in millis
getCreationTime
()

Return the creation time of the signature in milli-seconds.

public byte[]

Returns:

fingerprint (digest prefix) of the signature
getFingerPrint
()

Return the signatures fingerprint.

public int
getHashAlgorithm()

return the hashAlgorithm tag

public SignatureSubpacket[]
public int
getKeyAlgorithm()

return the encryption algorithm tag

public long

Returns:

the keyID that created the signature.
getKeyID
()

return the keyID

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.

public byte[]

Returns:

uninterpreted signature bytes.
getSignatureBytes
()

Return the byte encoding of the signature section.

public byte[]

Returns:

byte[]
getSignatureTrailer
()

return the signature trailer that must be included with the data to reconstruct the signature

public int
getSignatureType()

return the signature type.

public SignatureSubpacket[]
public int
getVersion()

get the version number

private void
Inherited from org.bouncycastle.bcpg.ContainedPacket:
getEncoded

Field Detail

creationTimeback to summary
private long creationTime
fingerPrintback to summary
private byte[] fingerPrint
hashAlgorithmback to summary
private int hashAlgorithm
hashedDataback to summary
private SignatureSubpacket[] hashedData
keyAlgorithmback to summary
private int keyAlgorithm
keyIDback to summary
private long keyID
signatureback to summary
private MPInteger[] signature
signatureEncodingback to summary
private byte[] signatureEncoding
signatureTypeback to summary
private int signatureType
unhashedDataback to summary
private SignatureSubpacket[] unhashedData
versionback to summary
private int version

Constructor Detail

SignaturePacketback to summary
pack-priv SignaturePacket(BCPGInputStream in) throws IOException
SignaturePacketback to summary
public SignaturePacket(int signatureType, long keyID, int keyAlgorithm, int hashAlgorithm, SignatureSubpacket[] hashedData, SignatureSubpacket[] unhashedData, byte[] fingerPrint, MPInteger[] signature)

Generate a version 4 signature packet.

SignaturePacketback to summary
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.

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

Method Detail

encodeback to summary
public void encode(BCPGOutputStream out) throws IOException

Implements abstract org.bouncycastle.bcpg.ContainedPacket.encode.

fromByteArrayback to summary
public static SignaturePacket fromByteArray(byte[] data) throws IOException
getCreationTimeback to summary
public long getCreationTime()

Return the creation time of the signature in milli-seconds.

Returns:long

the creation time in millis

getFingerPrintback to summary
public byte[] getFingerPrint()

Return the signatures fingerprint.

Returns:byte[]

fingerprint (digest prefix) of the signature

getHashAlgorithmback to summary
public int getHashAlgorithm()

return the hashAlgorithm tag

getHashedSubPacketsback to summary
public SignatureSubpacket[] getHashedSubPackets()
getKeyAlgorithmback to summary
public int getKeyAlgorithm()

return the encryption algorithm tag

getKeyIDback to summary
public long getKeyID()

return the keyID

Returns:long

the keyID that created the signature.

getSignatureback to summary
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.

getSignatureBytesback to summary
public byte[] getSignatureBytes()

Return the byte encoding of the signature section.

Returns:byte[]

uninterpreted signature bytes.

getSignatureTrailerback to summary
public byte[] getSignatureTrailer()

return the signature trailer that must be included with the data to reconstruct the signature

Returns:byte[]

byte[]

getSignatureTypeback to summary
public int getSignatureType()

return the signature type.

getUnhashedSubPacketsback to summary
public SignatureSubpacket[] getUnhashedSubPackets()
getVersionback to summary
public int getVersion()

get the version number

setCreationTimeback to summary
private void setCreationTime()