aboutsummaryrefslogtreecommitdiff
path: root/src/test/model/pki/crl/RevokedCertificateTest.java
blob: 744e57872036f08b0b22036df387583c8e9c8c88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package model.pki.crl;

import model.asn1.UtcTime;
import org.junit.jupiter.api.Test;

import static model.TestConstants.*;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class RevokedCertificateTest {
    @Test
    void testConstructor() {
        assertEquals(123, REVOKED_CESSATION.getSerialNumber().getLong());
        assertEquals(UtcTime.TAG.getNumber(), REVOKED_CESSATION.getRevocationDate().getTag().getNumber());
        assertEquals(Reason.CESSATION_OF_OPERATION, REVOKED_CESSATION.getReason());
    }

    @Test
    void testEncode() {
        assertArrayEquals(REVOKED_KEY_COMPROMISE_DER, REVOKED_KEY_COMPROMISE.encodeDER());
    }
}