eu.europa.esig.dss.utils.Utils.isArrayEmpty()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中eu.europa.esig.dss.utils.Utils.isArrayEmpty()方法的一些代码示例,展示了Utils.isArrayEmpty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.isArrayEmpty()方法的具体详情如下:
包路径:eu.europa.esig.dss.utils.Utils
类名称:Utils
方法名:isArrayEmpty

Utils.isArrayEmpty介绍

暂无

代码示例

代码示例来源:origin: esig/dss

@Test
public void isArrayEmptyObj() {
  assertTrue(Utils.isArrayEmpty(new Object[] {}));
  assertFalse(Utils.isArrayEmpty(new Object[] { null }));
  assertFalse(Utils.isArrayEmpty(new Object[] { "1", 1 }));
}

代码示例来源:origin: esig/dss

@Test
public void isArrayEmpty() {
  assertTrue(Utils.isArrayEmpty(new byte[] {}));
  assertFalse(Utils.isArrayEmpty(new byte[] { 1 }));
}

代码示例来源:origin: esig/dss

try {
  final byte[] ocspRespBytes = dataLoader.post(ocspAccessLocation, content);
  if (!Utils.isArrayEmpty(ocspRespBytes)) {
    final OCSPResp ocspResp = new OCSPResp(ocspRespBytes);
    OCSPRespStatus status = OCSPRespStatus.fromInt(ocspResp.getStatus());

代码示例来源:origin: esig/dss

@Test
public void parseCRLWithoutRevokedCertificates() throws IOException {
  try (InputStream fis = CRLParserTest.class.getResourceAsStream("/DS_NA2_CA-B1.crl");
      BufferedInputStream is = new BufferedInputStream(fis)) {
    CRLInfo handler = parser.retrieveInfo(is);
    assertEquals("1.2.840.113549.1.1.11", handler.getCertificateListSignatureAlgorithmOid());
    assertNotNull(handler.getIssuer());
    assertNotNull(handler.getThisUpdate());
    assertNotNull(handler.getNextUpdate());
    assertTrue(handler.getCriticalExtensions().isEmpty());
    assertTrue(!handler.getNonCriticalExtensions().isEmpty());
    assertTrue(Utils.isArrayEmpty(handler.getNonCriticalExtension("2.5.29.60")));
    assertEquals("1.2.840.113549.1.1.11", handler.getTbsSignatureAlgorithmOid());
    byte[] signatureValue = handler.getSignatureValue();
    assertTrue(Utils.isArrayNotEmpty(signatureValue));
  }
}

代码示例来源:origin: esig/dss

@Test
public void testExtension() throws IOException {
  try (InputStream fis = CRLParserTest.class.getResourceAsStream("/crl_with_expiredCertsOnCRL_extension.crl");
      BufferedInputStream is = new BufferedInputStream(fis)) {
    CRLInfo handler = parser.retrieveInfo(is);
    assertEquals("1.2.840.113549.1.1.11", handler.getCertificateListSignatureAlgorithmOid());
    assertNotNull(handler.getIssuer());
    assertNotNull(handler.getThisUpdate());
    assertNotNull(handler.getNextUpdate());
    assertTrue(!handler.getCriticalExtensions().isEmpty());
    assertTrue(Utils.isArrayNotEmpty(handler.getCriticalExtension("2.5.29.28")));
    assertTrue(Utils.isArrayEmpty(handler.getNonCriticalExtension("2.5.29.28")));
    assertTrue(!handler.getNonCriticalExtensions().isEmpty());
    assertTrue(Utils.isArrayNotEmpty(handler.getNonCriticalExtension("2.5.29.60")));
    assertTrue(Utils.isArrayEmpty(handler.getCriticalExtension("2.5.29.60")));
    assertEquals("1.2.840.113549.1.1.11", handler.getTbsSignatureAlgorithmOid());
    byte[] signatureValue = handler.getSignatureValue();
    assertTrue(Utils.isArrayNotEmpty(signatureValue));
  }
}

相关文章