Package eu.europa.esig.dss.tsl
Class KeyUsageCondition
- java.lang.Object
-
- eu.europa.esig.dss.spi.tsl.Condition
-
- eu.europa.esig.dss.tsl.KeyUsageCondition
-
- All Implemented Interfaces:
Serializable
public class KeyUsageCondition extends Condition
Condition based on the certificate key usage- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KeyUsageCondition(KeyUsageBit bit, boolean value)Constructs a new KeyUsageCondition.KeyUsageCondition(String usage, boolean value)Constructs a new KeyUsageCondition.
-
Method Summary
Modifier and Type Method Description booleancheck(CertificateToken certificateToken)Returns true if the condition is evaluated to true for the given certificate.KeyUsageBitgetBit()Returns the key usage to be checked.booleangetValue()Returns the required bit value of the key usage to be checked.StringtoString()StringtoString(String indent)Returns a string representation of the condition
-
-
-
Constructor Detail
-
KeyUsageCondition
public KeyUsageCondition(KeyUsageBit bit, boolean value)
Constructs a new KeyUsageCondition.- Parameters:
bit- the key usagevalue- the required value of the key usage bit
-
KeyUsageCondition
public KeyUsageCondition(String usage, boolean value)
Constructs a new KeyUsageCondition.- Parameters:
usage- the key usagevalue- the required value of the key usage bit
-
-
Method Detail
-
getBit
public final KeyUsageBit getBit()
Returns the key usage to be checked.- Returns:
- never
null
-
getValue
public final boolean getValue()
Returns the required bit value of the key usage to be checked.- Returns:
- the required bit value of the key usage to be checked
-
check
public boolean check(CertificateToken certificateToken)
Description copied from class:ConditionReturns true if the condition is evaluated to true for the given certificate.
-
toString
public String toString(String indent)
Description copied from class:ConditionReturns a string representation of the condition
-
-