Merge remote-tracking branch 'origin/dev-shangqing' into dev-shangqing

This commit is contained in:
yihzhou
2022-10-26 17:36:02 +08:00
5 changed files with 116 additions and 1 deletions
@@ -1,5 +1,6 @@
package com.sunyard.sydapi.test;
import com.sunyard.constant.CertUsage;
import com.sunyard.util.CertUtil;
import org.junit.Assert;
import org.junit.Test;
@@ -70,4 +71,40 @@ public class TestCertUtil {
);
}
@Test
public void certtype1() throws CertificateException, NoSuchProviderException {
Assert.assertTrue(
CertUtil.certUsageCheck( readCert("/x509/c1.crt") , CertUsage.digitalSignature , CertUsage.nonRepudiation )
);
}
@Test
public void certtype2() throws CertificateException, NoSuchProviderException {
Assert.assertTrue(
CertUtil.certUsageCheck( readCert("/x509/c2.crt") , CertUsage.keyEncipherment )
);
}
@Test
public void certtype4() throws CertificateException, NoSuchProviderException {
Assert.assertTrue(
CertUtil.certUsageCheck( readCert("/x509/c4.crt") , CertUsage.keyEncipherment )
);
}
@Test
public void certtype5() throws CertificateException, NoSuchProviderException {
Assert.assertTrue(
CertUtil.certUsageCheck( readCert("/x509/c5.crt") )
);
}
@Test
public void certtype6() throws CertificateException, NoSuchProviderException {
Assert.assertTrue(
CertUtil.certUsageCheck( readCert("/x509/c6.crt") , CertUsage.digitalSignature , CertUsage.nonRepudiation)
);
}
}