[Solved] How to get the public key? [closed]


I just downloaded your certificate and tested in my local

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.security.PublicKey;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;

public static void main(String[] args) throws FileNotFoundException, CertificateException {
         FileInputStream fin = new FileInputStream("C://Users/admin/Desktop/uidai_auth_stage.cer");
         CertificateFactory f = CertificateFactory.getInstance("X.509");
         X509Certificate certificate = (X509Certificate)f.generateCertificate(fin);
         PublicKey pk = certificate.getPublicKey();
         System.out.println(pk);
    }

Output

Sun RSA public key, 2048 bits
  modulus: 24997837043438188953607876466237786267538116823171823066632273818789601748586746440305433922940695151571735365523051675886995065116460565496861407875514773210269965513442232418015450789090428409276489545406694488823092308675874342532769927581914928367201662168201179961444037956523723476457691797490148453388604630304483861894406799761861931859139814624419421952118624143676117705606807289725313505871679662196624284199277807296317727434572557780473195825103383647653402128556252829571054599064686396724089686056490117328555759648852424450610766660552196304214260431235894942706902606159465251944070268033712979539561
  public exponent: 65537

2

solved How to get the public key? [closed]