Example usage for org.bouncycastle.asn1.x509 Time toASN1Primitive

List of usage examples for org.bouncycastle.asn1.x509 Time toASN1Primitive

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.x509 Time toASN1Primitive.

Prototype

public ASN1Primitive toASN1Primitive() 

Source Link

Document

Produce an object suitable for an ASN1OutputStream.

Usage

From source file:org.xipki.pki.ca.qa.X509CertprofileQa.java

License:Open Source License

private static void checkTime(Time time, ValidationIssue issue) {
    ASN1Primitive asn1Time = time.toASN1Primitive();
    if (time.getDate().getTime() / 1000 < EPOCHTIME_2050010100) {
        if (!(asn1Time instanceof ASN1UTCTime)) {
            issue.setFailureMessage("not encoded as UTCTime");
        }/* www  .j ava 2  s .c o m*/
    } else {
        if (!(asn1Time instanceof ASN1GeneralizedTime)) {
            issue.setFailureMessage("not encoded as GeneralizedTime");
        }
    }
}