Package org.bouncycastle.openpgp
Class PGPSignatureSubpacketVector
java.lang.Object
org.bouncycastle.openpgp.PGPSignatureSubpacketVector
Container for a list of signature subpackets.
-
Method Summary
Modifier and TypeMethodDescriptionstatic PGPSignatureSubpacketVector
fromSubpackets
(Collection<SignatureSubpacket> packets) static PGPSignatureSubpacketVector
fromSubpackets
(SignatureSubpacket[] packets) Create a newPGPSignatureSubpacketVector
from the givenSignatureSubpacket
.int[]
long
long
Return the number of seconds a key is valid for after its creation date.int
Deprecated.use getNotationDataOccurrences()getNotationDataOccurrences
(String notationName) Return allNotationData
occurrences which match the given notation name.int[]
Deprecated.usegetPreferredAEADCiphersuites()
orgetPreferredLibrePgpEncryptionModes()
instead.Return the preferred AEAD ciphersuites denoted in the signature.int[]
int[]
int[]
Return the preferred LibrePGP encryption modes denoted in the signature.int[]
long
Return the number of seconds a signature is valid for after its creation date.getSubpacket
(int type) getSubpackets
(int type) Return all signature subpackets of the passed in type.getTrust()
boolean
hasSubpacket
(int type) Return true if a particular subpacket type exists.boolean
boolean
boolean
int
size()
Return the number of packets this vector contains.toArray()
Return a copy of the subpackets in this vector.
-
Method Details
-
fromSubpackets
Create a newPGPSignatureSubpacketVector
from the givenCollection
ofSignatureSubpacket
items. If the collection isnull
, return an emptyPGPSignatureSubpacketVector
.- Parameters:
packets
- collection of items or null- Returns:
- PGPSignatureSubpacketVector
-
fromSubpackets
Create a newPGPSignatureSubpacketVector
from the givenSignatureSubpacket
. If the array isnull
, return an emptyPGPSignatureSubpacketVector
.- Parameters:
packets
- array of items or null- Returns:
- PGPSignatureSubpacketVector
-
getSubpacket
-
hasSubpacket
public boolean hasSubpacket(int type) Return true if a particular subpacket type exists.- Parameters:
type
- type to look for.- Returns:
- true if present, false otherwise.
-
getSubpackets
Return all signature subpackets of the passed in type.- Parameters:
type
- subpacket type code- Returns:
- an array of zero or more matching subpackets.
-
getEmbeddedSignatures
- Throws:
PGPException
-
getNotationDataOccurrences
-
getNotationDataOccurences
Deprecated.use getNotationDataOccurrences() -
getNotationDataOccurrences
Return allNotationData
occurrences which match the given notation name.- Parameters:
notationName
- notation name- Returns:
- notations with matching name
-
getIssuerKeyID
public long getIssuerKeyID() -
getSignatureCreationTime
-
getSignatureExpirationTime
public long getSignatureExpirationTime()Return the number of seconds a signature is valid for after its creation date. A value of zero means the signature never expires.- Returns:
- seconds a signature is valid for.
-
getKeyExpirationTime
public long getKeyExpirationTime()Return the number of seconds a key is valid for after its creation date. A value of zero means the key never expires.- Returns:
- seconds a key is valid for.
-
getPreferredHashAlgorithms
public int[] getPreferredHashAlgorithms() -
getPreferredSymmetricAlgorithms
public int[] getPreferredSymmetricAlgorithms() -
getPreferredCompressionAlgorithms
public int[] getPreferredCompressionAlgorithms() -
getPreferredAEADAlgorithms
Deprecated.usegetPreferredAEADCiphersuites()
orgetPreferredLibrePgpEncryptionModes()
instead.This method is BROKEN!- Returns:
- preferred AEAD Algorithms
-
getPreferredAEADCiphersuites
Return the preferred AEAD ciphersuites denoted in the signature.- Returns:
- OpenPGP AEAD ciphersuites
-
getPreferredLibrePgpEncryptionModes
public int[] getPreferredLibrePgpEncryptionModes()Return the preferred LibrePGP encryption modes denoted in the signature. Note: The LibrePGP spec states that this subpacket shall be ignored and the application shall instead assumeAEADAlgorithmTags.OCB
.- Returns:
- LibrePGP encryption modes
-
getKeyFlags
public int getKeyFlags() -
getSignerUserID
-
isPrimaryUserID
public boolean isPrimaryUserID() -
getCriticalTags
public int[] getCriticalTags() -
getSignatureTarget
-
getFeatures
-
getIssuerFingerprint
-
getIntendedRecipientFingerprint
-
getIntendedRecipientFingerprints
-
getExportable
-
isExportable
public boolean isExportable() -
getPolicyURI
-
getPolicyURIs
-
getRegularExpression
-
getRegularExpressions
-
getRevocable
-
isRevocable
public boolean isRevocable() -
getRevocationKeys
-
getRevocationReason
-
getTrust
-
size
public int size()Return the number of packets this vector contains.- Returns:
- size of the packet vector.
-
toArray
Return a copy of the subpackets in this vector.- Returns:
- an array containing the vector subpackets in order.
-