org.bouncycastle.asn1.test
Class AllowZonelessUTCTimeTest
java.lang.Object
org.bouncycastle.util.test.SimpleTest
org.bouncycastle.asn1.test.AllowZonelessUTCTimeTest
- All Implemented Interfaces:
- Test
- public class AllowZonelessUTCTimeTest
- extends SimpleTest
Exercises the read-side structural validation of ASN.1 UTCTime / GeneralizedTime content and the
one exception to it, the org.bouncycastle.asn1.allow_zoneless_utctime property
(Properties.ASN1_ALLOW_ZONELESS_UTCTIME). Since 1.85 structurally malformed content - non-digit
or out-of-range fields, an illegal length, a missing or garbage zone terminator - is rejected
when it is decoded, which fails the parse of whatever structure carries it.
Setting the property admits the zone-less UTCTime "YYMMDDHHMMSS" (github #2411) and nothing
else, as its name says: the value is not a legal UTCTime, X.680 sec. 47.3 making the zone
mandatory, but getTime() has always read it as GMT so it denotes a real instant. Every other
malformed value is still rejected with the property set, and the value itself does not decode
at all without it.
| Methods inherited from class org.bouncycastle.util.test.SimpleTest |
areEqual, areEqual, areEqual, fail, fail, fail, isEquals, isEquals, isEquals, isEquals, isEquals, isEquals, isEquals, isTrue, isTrue, perform, runTest, runTest, runTests, runTests, testException |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AllowZonelessUTCTimeTest
public AllowZonelessUTCTimeTest()
getName
public java.lang.String getName()
- Specified by:
getName in interface Test- Specified by:
getName in class SimpleTest
performTest
public void performTest()
throws java.lang.Exception
- Specified by:
performTest in class SimpleTest
- Throws:
java.lang.Exception
main
public static void main(java.lang.String[] args)