mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-06-17 00:54:50 +02:00
30 lines
997 B
Java
30 lines
997 B
Java
// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package org.pgpainless.algorithm;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
|
import java.util.List;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
public class SignatureSubpacketTest {
|
|
|
|
@Test
|
|
public void testFromCodes() {
|
|
int[] codes = new int[] {
|
|
SignatureSubpacket.issuerKeyId.getCode(),
|
|
SignatureSubpacket.preferredSymmetricAlgorithms.getCode(),
|
|
SignatureSubpacket.preferredHashAlgorithms.getCode()
|
|
};
|
|
|
|
List<SignatureSubpacket> subpacketList = SignatureSubpacket.fromCodes(codes);
|
|
assertEquals(3, subpacketList.size());
|
|
assertEquals(SignatureSubpacket.issuerKeyId, subpacketList.get(0));
|
|
assertEquals(SignatureSubpacket.preferredSymmetricAlgorithms, subpacketList.get(1));
|
|
assertEquals(SignatureSubpacket.preferredHashAlgorithms, subpacketList.get(2));
|
|
}
|
|
}
|