-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
31 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<modelVersion>4.0.0</modelVersion> | ||
<groupId>br.com.swconsultoria</groupId> | ||
<artifactId>java_certificado</artifactId> | ||
<version>3.7-SNAPSHOT</version> | ||
<version>3.8-SNAPSHOT</version> | ||
<name>Java_Certificado</name> | ||
<description>Api java para gerenciamento de certificados digitais</description> | ||
<url>https://github.com/Samuel-Oliveira/Java_Certificado</url> | ||
|
@@ -19,7 +19,7 @@ | |
<url>https://github.com/Samuel-Oliveira/Java_Certificado</url> | ||
<connection>scm:git:[email protected]:Samuel-Oliveira/Java_Certificado.git</connection> | ||
<developerConnection>scm:git:[email protected]:Samuel-Oliveira/Java_Certificado.git</developerConnection> | ||
<tag>java_certificado-3.4</tag> | ||
<tag>java_certificado-a-3.7</tag> | ||
</scm> | ||
|
||
<properties> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,8 +49,8 @@ public static void inicializaCertificado(Certificado certificado, InputStream ca | |
|
||
log.info(String.format("JAVA-CERTIFICADO | Samuel Oliveira | [email protected] " + | ||
"| VERSAO=%s | DATA_VERSAO=%s | CNPJ/CPF=%s | VENCIMENTO=%s | ALIAS=%s | TIPO=%s | CAMINHO=%s | CACERT=%s | SSL=%s", | ||
"3.6", | ||
"08/06/2024", | ||
"3.7", | ||
"11/07/2024", | ||
certificado.getCnpjCpf(), | ||
certificado.getDataHoraVencimento(), | ||
certificado.getNome().toUpperCase(), | ||
|
@@ -144,15 +144,23 @@ public static Certificado certificadoA3(String senha, Provider provider) throws | |
|
||
} | ||
|
||
public static List<Certificado> listaCertificadosWindows(boolean listarVencidos) throws CertificadoException { | ||
return listaCertificadosRepositorio(TipoCertificadoEnum.REPOSITORIO_WINDOWS, listarVencidos); | ||
} | ||
|
||
public static List<Certificado> listaCertificadosMac(boolean listarVencidos) throws CertificadoException { | ||
return listaCertificadosRepositorio(TipoCertificadoEnum.REPOSITORIO_MAC, listarVencidos); | ||
} | ||
|
||
public static List<Certificado> listaCertificadosWindows() throws CertificadoException { | ||
return listaCertificadosRepositorio(TipoCertificadoEnum.REPOSITORIO_WINDOWS); | ||
return listaCertificadosRepositorio(TipoCertificadoEnum.REPOSITORIO_WINDOWS, true); | ||
} | ||
|
||
public static List<Certificado> listaCertificadosMac() throws CertificadoException { | ||
return listaCertificadosRepositorio(TipoCertificadoEnum.REPOSITORIO_MAC); | ||
return listaCertificadosRepositorio(TipoCertificadoEnum.REPOSITORIO_MAC, true); | ||
} | ||
|
||
private static List<Certificado> listaCertificadosRepositorio(TipoCertificadoEnum tipo) throws CertificadoException { | ||
private static List<Certificado> listaCertificadosRepositorio(TipoCertificadoEnum tipo, boolean listarVencidos) throws CertificadoException { | ||
|
||
List<Certificado> listaCert = new ArrayList<>(); | ||
Certificado cert = new Certificado(); | ||
|
@@ -167,7 +175,13 @@ private static List<Certificado> listaCertificadosRepositorio(TipoCertificadoEnu | |
certificado.setTipoCertificado(tipo); | ||
certificado.setNome(aliasKey); | ||
setDadosCertificado(certificado, ks); | ||
listaCert.add(certificado); | ||
if (listarVencidos) { | ||
listaCert.add(certificado); | ||
} else { | ||
if (certificado.isValido()) { | ||
listaCert.add(certificado); | ||
} | ||
} | ||
} | ||
} | ||
} catch (KeyStoreException ex) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.