public class CertificateValidity
extends java.lang.Object
implements com.tencent.kona.sun.security.util.DerEncoder
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
| Constructor and Description |
|---|
CertificateValidity(java.util.Date notBefore,
java.util.Date notAfter)
The constructor for this class for the specified interval.
|
CertificateValidity(com.tencent.kona.sun.security.util.DerInputStream in)
Create the object, decoding the values from the passed DER stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
encode(com.tencent.kona.sun.security.util.DerOutputStream out)
Encode the CertificateValidity period in DER form to the stream.
|
java.util.Date |
getNotAfter() |
java.util.Date |
getNotBefore() |
java.lang.String |
toString()
Return the validity period as user readable string.
|
void |
valid()
Verify that the current time is within the validity period.
|
void |
valid(java.util.Date now)
Verify that the passed time is within the validity period.
|
public static final java.lang.String NAME
public CertificateValidity(java.util.Date notBefore,
java.util.Date notAfter)
notBefore - the date and time before which the certificate
is not validnotAfter - the date and time after which the certificate is
not validpublic CertificateValidity(com.tencent.kona.sun.security.util.DerInputStream in)
throws java.io.IOException
in - the DerInputStream to read the CertificateValidity fromjava.io.IOException - on decoding errors.public java.util.Date getNotBefore()
public java.util.Date getNotAfter()
public java.lang.String toString()
toString in class java.lang.Objectpublic void encode(com.tencent.kona.sun.security.util.DerOutputStream out)
encode in interface com.tencent.kona.sun.security.util.DerEncoderout - the DerOutputStream to marshal the contents to.public void valid()
throws java.security.cert.CertificateNotYetValidException,
java.security.cert.CertificateExpiredException
java.security.cert.CertificateExpiredException - if the certificate has expired.java.security.cert.CertificateNotYetValidException - if the certificate is not
yet valid.public void valid(java.util.Date now)
throws java.security.cert.CertificateNotYetValidException,
java.security.cert.CertificateExpiredException
now - the Date against which to compare the validity
period.java.security.cert.CertificateExpiredException - if the certificate has expired
with respect to the Date supplied.java.security.cert.CertificateNotYetValidException - if the certificate is not
yet valid with respect to the Date supplied.