Package org.pgpainless.algorithm
Enum Class KeyFlag
- All Implemented Interfaces:
Serializable
,Comparable<KeyFlag>
,Constable
Enumeration of different key flags.
Key flags denote different capabilities of a key pair.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThis key may be used for authentication.This key may be used to certify other keys.This key may be used to encrypt communications.This key may be used to encrypt storage.The private component of this key may be in the possession of more than one person.This key may be used to sign data.The private component of this key may have been split by a secret-sharing mechanism. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
containsAny
(int mask, KeyFlag... flags) fromBitmask
(int bitmask) Convert a bitmask into a list ofKeyFlags
.int
getFlag()
Return the numeric id of theKeyFlag
.static boolean
hasKeyFlag
(int mask, KeyFlag flag) Return true if the provided bitmask has the bit for the provided flag set.static int
Encode a list ofKeyFlags
into a bitmask.static KeyFlag
Returns the enum constant of this class with the specified name.static KeyFlag[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CERTIFY_OTHER
This key may be used to certify other keys. -
SIGN_DATA
This key may be used to sign data. -
ENCRYPT_COMMS
This key may be used to encrypt communications. -
ENCRYPT_STORAGE
This key may be used to encrypt storage. -
SPLIT
The private component of this key may have been split by a secret-sharing mechanism. -
AUTHENTICATION
This key may be used for authentication. -
SHARED
The private component of this key may be in the possession of more than one person.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
getFlag
public int getFlag()Return the numeric id of theKeyFlag
.- Returns:
- numeric id
-
fromBitmask
Convert a bitmask into a list ofKeyFlags
.- Parameters:
bitmask
- bitmask- Returns:
- list of key flags encoded by the bitmask
-
toBitmask
Encode a list ofKeyFlags
into a bitmask.- Parameters:
flags
- list of flags- Returns:
- bitmask
-
hasKeyFlag
Return true if the provided bitmask has the bit for the provided flag set. Return false if the mask does not contain the flag.- Parameters:
mask
- bitmaskflag
- flag to be tested for- Returns:
- true if flag is set, false otherwise
-
containsAny
-