Package org.pgpainless.algorithm
Enum Feature
- java.lang.Object
-
- java.lang.Enum<Feature>
-
- org.pgpainless.algorithm.Feature
-
- All Implemented Interfaces:
Serializable
,Comparable<Feature>
public enum Feature extends Enum<Feature>
An enumeration of features that may be set in theFeatures
subpacket.- See Also:
- RFC4880: Features
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AEAD_ENCRYPTED_DATA
Support for Authenticated Encryption with Additional Data (AEAD).MODIFICATION_DETECTION
Support for Symmetrically Encrypted Integrity Protected Data Packets using Modification Detection Code Packets.VERSION_5_PUBLIC_KEY
If a key announces this feature, it is a version 5 public key.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<Feature>
fromBitmask(int bitmask)
Convert a bitmask into a list ofKeyFlags
.static Feature
fromId(byte id)
byte
getFeatureId()
static byte
toBitmask(Feature... features)
Encode a list ofKeyFlags
into a bitmask.static Feature
valueOf(String name)
Returns the enum constant of this type with the specified name.static Feature[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MODIFICATION_DETECTION
public static final Feature MODIFICATION_DETECTION
Support for Symmetrically Encrypted Integrity Protected Data Packets using Modification Detection Code Packets.
-
AEAD_ENCRYPTED_DATA
public static final Feature AEAD_ENCRYPTED_DATA
Support for Authenticated Encryption with Additional Data (AEAD). If a key announces this feature, it signals support for consuming AEAD Encrypted Data Packets. NOTE: PGPAINLESS DOES NOT YET SUPPORT THIS FEATURE!!!- See Also:
- AEAD Encrypted Data Packet
-
VERSION_5_PUBLIC_KEY
public static final Feature VERSION_5_PUBLIC_KEY
If a key announces this feature, it is a version 5 public key. The version 5 format is similar to the version 4 format except for the addition of a count for the key material. This count helps to parse secret key packets (which are an extension of the public key packet format) in the case of an unknown algorithm. In addition, fingerprints of version 5 keys are calculated differently from version 4 keys. NOTE: PGPAINLESS DOES NOT YET SUPPORT THIS FEATURE!!!- See Also:
- Public-Key Packet Formats
-
-
Method Detail
-
values
public static Feature[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Feature c : Feature.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Feature valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getFeatureId
public byte getFeatureId()
-
fromBitmask
public static List<Feature> fromBitmask(int bitmask)
Convert a bitmask into a list ofKeyFlags
.- Parameters:
bitmask
- bitmask- Returns:
- list of key flags encoded by the bitmask
-
-