Package org.pgpainless.key.util
Enum Class RevocationAttributes.Reason
- All Implemented Interfaces:
Serializable
,Comparable<RevocationAttributes.Reason>
,Constable
- Enclosing class:
- RevocationAttributes
Reason for revocation.
There are two kinds of reasons: hard and soft reason.
Soft revocation reasons gracefully disable keys or user-ids.
Softly revoked keys can no longer be used to encrypt data to or to generate signatures.
Any signature made after a key has been soft revoked is deemed invalid.
Any signature made before the key has been soft revoked stays valid.
Soft revoked info can be re-certified at a later point.
Hard revocation reasons on the other hand renders the key or user-id invalid immediately.
Hard reasons are suitable to use if for example a key got compromised.
Any signature made before or after a key has been hard revoked is no longer considered valid.
Hard revoked information can also not be re-certified.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe key has potentially been compromised.The key was retired and shall no longer be used.The key was superseded by another key.The key or certification is being revoked without a reason.The user-id is no longer valid. -
Method Summary
Modifier and TypeMethodDescriptionbyte
code()
static RevocationAttributes.Reason
fromCode
(byte code) Decode a machine-readable reason code.static boolean
isHardRevocation
(byte code) Return true if theRevocationAttributes.Reason
the provided code encodes is a hard revocation reason, false otherwise.static boolean
Return true if the givenRevocationAttributes.Reason
is a hard revocation, false otherwise.toString()
static RevocationAttributes.Reason
Returns the enum constant of this class with the specified name.static RevocationAttributes.Reason[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NO_REASON
The key or certification is being revoked without a reason. This is a HARD revocation reason and cannot be undone. -
KEY_SUPERSEDED
The key was superseded by another key. This is a SOFT revocation reason and can be undone. -
KEY_COMPROMISED
The key has potentially been compromised. This is a HARD revocation reason and cannot be undone. -
KEY_RETIRED
The key was retired and shall no longer be used. This is a SOFT revocation reason can can be undone. -
USER_ID_NO_LONGER_VALID
The user-id is no longer valid. This is a SOFT revocation reason and can be undone.
-
-
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
-
fromCode
Decode a machine-readable reason code.- Parameters:
code
- byte- Returns:
- reason
-
isHardRevocation
public static boolean isHardRevocation(byte code) Return true if theRevocationAttributes.Reason
the provided code encodes is a hard revocation reason, false otherwise. Hard revocations cannot be undone, while keys or certifications with soft revocations can be re-certified by placing another signature on them.- Parameters:
code
- reason code- Returns:
- is hard
-
isHardRevocation
Return true if the givenRevocationAttributes.Reason
is a hard revocation, false otherwise. Hard revocations cannot be undone, while keys or certifications with soft revocations can be re-certified by placing another signature on them.- Parameters:
reason
- reason- Returns:
- is hard
-
code
public byte code() -
toString
- Overrides:
toString
in classEnum<RevocationAttributes.Reason>
-