Changeset 4123 for branches/2.2.0.1/security/ExpressoCert/src
- Timestamp:
- 04/25/11 09:43:20 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.0.1/security/ExpressoCert/src/br/gov/serpro/cert/DigitalCertificate.java
r3633 r4123 58 58 import java.io.OutputStreamWriter; 59 59 import java.security.AlgorithmParameters; 60 import java.security.cert.CertificateEncodingException; 60 61 import java.util.regex.Matcher; 61 62 import java.util.regex.Pattern; … … 89 90 private FileInputStream pkcs12Input; // stream da KeyStore pkcs12. Pode ser nulo. 90 91 private String providerName; // Nome do SecurityProvider pkcs11 carregado. Pode ser nulo. 91 private String hostAddress; // Endereço do host, onde a página principal do92 private URL pageAddress; // Endereço do host, onde a página principal do 92 93 private static final String HOME_SUBDIR; // Subdiretório dentro do diretório home do usuário. Dependente de SO. 93 94 private static final String EPASS_2000; // Caminho da biblioteca do token ePass2000. Dependente de SO. … … 164 165 */ 165 166 public DigitalCertificate() { 166 this. hostAddress = null;167 this.pageAddress = null; 167 168 this.parentFrame = null; 168 169 } … … 173 174 */ 174 175 private DigitalCertificate(URL pageAddress) { 175 this. hostAddress = pageAddress.getHost();176 this.pageAddress = pageAddress; 176 177 this.parentFrame = null; 177 178 } 178 179 179 180 private DigitalCertificate(Frame parent) { 180 this. hostAddress = null;181 this.pageAddress = null; 181 182 this.parentFrame = parent; 182 183 } … … 236 237 this.selectedCertificateAlias = null; 237 238 this.keyStore = null; 238 this.hostAddress = null;239 239 this.pkcs12Input = null; 240 240 this.providerName = null; … … 647 647 * Pega as credenciais de login do dono do certificado do serviço de verificação de certificados 648 648 * @param pin pin para acessar o token 649 * @param where URL que será acessada para recuperar as credenciais 649 650 * @return resposta Array de Strings em que: 650 651 * Indice 0: código de retorno; … … 656 657 * @throws GeneralSecurityException 657 658 */ 658 public String[] getCredentials(String pin) throws SSLHandshakeException, HttpException, IOException, GeneralSecurityException { 659 660 public String[] getCredentials(String pin, URL where) throws SSLHandshakeException, HttpException, IOException, GeneralSecurityException { 659 661 660 662 String[] resposta = null; … … 679 681 Integer.parseInt(System.getProperty("http.proxyPort"))); 680 682 } 681 PostMethod httppost = new PostMethod("https://" + hostAddress + "/security/vercert.php"); 682 683 684 PostMethod httppost = new PostMethod(where.toExternalForm()); 685 683 686 try { 684 687 // Adiciona parâmetro certificado no método post, executa o método, pega a resposta do servidor … … 800 803 801 804 /** 805 * Get a PEM encoded instance of the user certificate 806 * @return PEM encoded Certificate 807 * @throws CertificateEncodingException 808 */ 809 public String getPEMCertificate() throws CertificateEncodingException { 810 return Base64Utils.der2pem(this.cert.getEncoded()); 811 } 812 813 /** 802 814 * @param cert the cert to set 803 815 */
Note: See TracChangeset
for help on using the changeset viewer.