View Javadoc

1   package es.caib.signatura.impl;
2   
3   import java.security.cert.X509Certificate;
4   import java.util.HashMap;
5   import java.util.List;
6   
7   /**
8    * @author e43155798r
9    * 
10   */
11  /**
12   * @author e43155798r
13   *
14   */
15  /**
16   * @author e43155798r
17   *
18   */
19  public interface CertificateProvider {	
20  	
21  	/**
22  	 * Busca por alias en el almacén de certificados.
23  	 * @param regExp
24  	 * @return List<String>
25  	 */
26  	public List findByAlias(String regExp) throws CertificateProviderException;
27  	
28  	/**
29  	 * @param alias
30  	 * @param keyAlgorithm
31  	 * @param keySize
32  	 * @param commonName
33  	 * @param organizationUnit
34  	 * @param organizationName
35  	 * @param cityName
36  	 * @param province
37  	 * @param state
38  	 * @param keyPass
39  	 * @param keystorePass
40  	 * @throws CertificateProviderException
41  	 */
42  	public void createCertificate(
43  			String alias, String keyAlgorithm, int keySize, String commonName, String organizationUnit, String organizationName,
44  			String cityName, String province, String state, String keyPass, String keystorePass) throws CertificateProviderException;
45  
46  	/**
47  	 * @param alias
48  	 * @param keyPass
49  	 * @param keystorePass
50  	 * @return
51  	 * @throws CertificateProviderException
52  	 */
53  	public byte[] createPKCS10Request(String alias, String keyPass, String keystorePass) throws CertificateProviderException;
54  
55  	/**
56  	 * Instala una respuesta a una petición PKCS10 y retorna una 
57  	 * @param response
58  	 * @param alias
59  	 * @param keyPass
60  	 * @param keystorePass
61  	 * @return
62  	 * @throws CertificateProviderException
63  	 */
64  	public X509Certificate[] installPKCS10Response(byte[] response, String alias, String keyPass, String keystorePass) throws CertificateProviderException;
65  
66  	/**
67  	 * Borra un certificado y sus claves asociadas.
68  	 * @param alias
69  	 * @throws CertificateProviderException
70  	 */
71  	public void deleteCertificate(String alias) throws CertificateProviderException;
72  	
73  	
74  	/**
75  	 * @return
76  	 */
77  	public List getKeyStoreElements() throws CertificateProviderException;
78  	
79  	/**
80  	 * Devuelve un HashMap donde las claves son los alias del keystore y los valores son
81  	 * los certificados asociados a esos alias.
82  	 * @return
83  	 */
84  	public HashMap getKeyStoreElementsHashMap() throws CertificateProviderException;
85  	
86  	/**
87  	 * @return
88  	 * @throws CertificateProviderException
89  	 */
90  	public boolean isLoggedIn() throws CertificateProviderException;
91  		
92  }