I want to read the certificate from eToken, when it is connected, when I store this certificate on the local computer, I can read it through my Java application, but I do not know how to read it from eToken.
RSAPublicKey pub; String fileName = "C:\\myCert.cer"; InputStream inStream = new FileInputStream(fileName); CertificateFactory cf = CertificateFactory.getInstance("X.509"); X509Certificate cert = (X509Certificate)cf.generateCertificate(inStream); inStream.close(); pub = (RSAPublicKey) cert.getPublicKey(); System.out.println(cert.getIssuerDN()); System.out.println(cert.getSubjectDN()); System.out.println(cert.getSubjectAlternativeNames()); byte [] tempPub = pub.getEncoded(); String sPub = new String( tempPub );
java certificate cryptography encryption devicetoken
Pravin
source share