public class OptionalValidity extends java.lang.Object implements ASN1Type
OptionalValidity ::= SEQUENCE {
notBefore [0] Time OPTIONAL,
notAfter [1] Time OPTIONAL
} --at least one MUST be present
| Constructor and Description |
|---|
OptionalValidity(ASN1Object obj)
Creates a
OptionalValidity object from an
ASN1Object. |
OptionalValidity(ChoiceOfTime time,
boolean notBefore)
Creates a new
OptionalValidity object with only one of the
fields set. |
OptionalValidity(ChoiceOfTime notBefore,
ChoiceOfTime notAfter)
Creates a new
OptionalValidity object with both the notBefore
and the notAfter fields set. |
| Modifier and Type | Method and Description |
|---|---|
void |
decode(ASN1Object obj)
Decodes a OptionalValidity structure from an
ASN1Object. |
ChoiceOfTime |
getNotAfter()
Returns the notAfter date if it has been set; otherwise
null is
returned. |
ChoiceOfTime |
getNotBefore()
Returns the notBefore date if it has been set; otherwise
null
is returned. |
ASN1Object |
toASN1Object()
Encodes this
OptionalValidity as an ASN1Object. |
java.lang.String |
toString()
Creates a text representation of the ASN.1 structure of this
OptionalValidity object. |
public OptionalValidity(ChoiceOfTime time, boolean notBefore)
OptionalValidity object with only one of the
fields set. If the notBefore parameter is true, then the
notBefore field is set; if the notBefore parameter is false,
then the notAfter field is set.time - the time/datenotBefore - indicates which field to set with the time/datepublic OptionalValidity(ChoiceOfTime notBefore, ChoiceOfTime notAfter)
OptionalValidity object with both the notBefore
and the notAfter fields set.notBefore - the time/date the certificate should become validnotAfter - the time/date the certificate should become invalidpublic OptionalValidity(ASN1Object obj) throws CodingException
OptionalValidity object from an
ASN1Object.obj - the ASN.1 representation of a OptionalValidity structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic ChoiceOfTime getNotBefore()
null
is returned.public ChoiceOfTime getNotAfter()
null is
returned.public void decode(ASN1Object obj) throws CodingException
ASN1Object.decode in interface ASN1Typeobj - an ASN.1 representation of a OptionalValidity structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic ASN1Object toASN1Object()
OptionalValidity as an ASN1Object.toASN1Object in interface ASN1Typepublic java.lang.String toString()
OptionalValidity object.toString in class java.lang.Object