Certificates conversion.. from PKCS12 to x.509 how to ?

Can I transform a received pkcs12 certificate to a x.509 one ?
[83 byte] By [FelipeGaucho] at [2007-9-26 6:44:01]
# 1

I'm using the following code :

import java.security.cert.*;

import java.io.*;

import java.util.*;

public class PrintCert

{

static public void main(String[] args)

{

try

{

FileInputStream fis = new FileInputStream(args[0]);

CertificateFactory cf = CertificateFactory.getInstance("X.509");

Collection c = cf.generateCertificates(fis);

int ago = 0;

Iterator i = c.iterator();

while (i.hasNext()) {

Certificate cert = (Certificate)i.next();

System.out.println("\nTag "+ (ago++) + cert);

}

}

catch(Exception error)

{

System.out.println("Erro: "+error.getMessage());

}

}

}

and it is not working for pkcs12 certificate types

FelipeGaucho at 2007-7-1 16:05:44 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...